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

103 commits

Author SHA1 Message Date
Andy Wingo
d94be25f72 remove dead weight from vm-i-system.c
* libguile/vm-i-system.c: Remove mark, list-mark, cons-mark,
  vector-mark, and list-break, as they are no longer used.
  (call, goto/args, mv-call): Remove bits about trampolines, which was
  slower, and VM continuations, which are not used (we use Guile's
  continuations as the applicable objects).

  Renumber ops.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
2009-08-20 18:52:49 +02:00
Andy Wingo
aaae0d5ab3 "fix" <let>-bound lambda expressions too
* module/language/tree-il/compile-glil.scm (compile-glil): Compute
  warnings before optimizing, as unreferenced variables will be
  optimized out.

* libguile/_scm.h: Fix C99 comment.

* module/language/tree-il/fix-letrec.scm (partition-vars): Also analyze
  let-bound vars.
  (fix-letrec!): Fix a bug whereby a set! to an unreffed var would be
  called for value, not effect. Also "fix" <let>-bound lambda
  expressions -- really speeds up pmatch.

* test-suite/tests/tree-il.test ("lexical sets", "the or hack"): Update
  to take into account the new optimizations.
2009-08-12 21:29:08 +02:00
Andy Wingo
94ff26b96b rework the vm support for wide strings
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* libguile/vm-engine.c (vm_error_bad_wide_string_length): New error
  case.

* libguile/vm-i-loader.c (load-unsigned-integer, load-integer)
  (load-keyword): Remove these instructions. The former two are
  obsoleted by make-int64/make-uint64, the latter via make-keyword.
  (load-string): Only handle narrow strings.
  (load-symbol): Only handle narrow symbols. The wide case is handled
  via make-symbol.
  (load-wide-string): New instruction, for wide strings.

* libguile/vm-i-system.c (define): Move here from loaders.c, as now it
  just takes a sym on the stack.
  (make-keyword, make-symbol): New instructions.

* module/language/assembly.scm: Remove removed instructions. No more
  width byte in load-string etc.

* module/language/assembly/compile-bytecode.scm (write-bytecode): Adapt
  to change in instruction set.

* module/language/glil/compile-assembly.scm (glil->assembly): Compile
  define by pushing the sym then emitting (define).
  (dump-object): Dump narrow and wide strings differently. Use
  make-keyword and make-symbol as appropriate.

* module/language/tree-il/compile-glil.scm (flatten): When compiling a
  ref to a primitive (not a call), first see if the primitive is
  actually bound in the root module. (That's not the case with e.g.
  bytevector-u8-ref).

* module/system/xref.scm (program-callee-rev-vars): Don't parse out
  "nexts".

* test-suite/tests/asm-to-bytecode.test ("compiler"): Adapt to bytecode
  format change.
2009-08-12 16:34:05 +02:00
Andy Wingo
6e5c02b8a3 make the fallback path look less like line noise
* libguile/_scm.h:
* libguile/load.c: Rework to only include the relevant pieces in the
  fallback path.
2009-08-11 21:16:05 +02:00
Andy Wingo
86cfb42d56 include objcode cookie in the fallback path
* libguile/_scm.h (SCM_OBJCODE_COOKIE): Move the objcode cookie define
  here, so that load.c can use it. This is a private header.

* libguile/load.c (FALLBACK_DIR): Include the objcode cookie in the
  fallback path. Should fix problems when objcode changes incompatibly
  during the 1.9 series.

* libguile/objcodes.c: Adapt to SCM_OBJCODE_COOKIE move.

This should fix http://article.gmane.org/gmane.lisp.guile.devel/9059.
2009-08-11 20:25:44 +02:00
Neil Jerram
0ebbcf43c4 Remove AC_SYS_RESTARTABLE_SYSCALLS and related code
As the Autoconf documentation says, "These days portable programs
[...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays
whether a system call is restartable is a dynamic issue, not a
configuration-time issue."

In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are
at the mercy of any code that Guile happens to be linked with, because
that code could install a signal handler without the SA_RESTART flag,
and then a Guile system call could unexpectedly return EINTR.

The readline part of this goes back to this problem report:
http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an
excellent example of the above paragraph.  It was noted during the
discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the
problem, but that solution wasn't adopted - I guess because Guile was
still using cooperative threads then (not pthreads) and so there was a
significant concern (whether founded or not) that not using
restartable syscalls (where available) could lead to a loss of
performance.

Now Guile's default mode of operation is with pthreads, where we
already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so
there is no possible further performance loss.  And in any case we
really have no choice, if we want correct operation.

Thanks to Sylvain Beucler for reporting this and suggesting the fix.

* configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed.

* doc/ref/posix.texi (Signals): Remove statement that Guile always
  sets SA_RESTART flag.

* guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED):
  Remove this setting, together with its test code.
  (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no
  longer needed.

* guile-readline/readline.c (sigwinch_enable_restart): Removed.
  (scm_init_readline): Remove setting of rl_pre_input_hook.

* libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on
  HAVE_RESTARTABLE_SYSCALLS.

* libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the
  SA_RESTART flag if available.  Update docstring accordingly.
  (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all
  signals.

* THANKS: Add Sylvain.
2009-06-23 23:04:41 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
bb2e15a5f4 Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
Conflicts:
	.gitignore
	libguile/procs.h
2009-02-14 17:47:24 +01:00
Neil Jerram
cbee5075d6 Fix MinGW HAVE_STRUCT_TIMESPEC build problem
Reported by Carlo Bramini.  See the comment in _scm.h.

* THANKS: Add Carlo Bramini.

* libguile/_scm.h: Undefine HAVE_STRUCT_TIMESPEC.
2009-01-23 01:05:19 +00:00
Ludovic Courtès
c6054feaf0 Add support for static allocation of cells, strings and stringbufs.
* libguile/__scm.h (SCM_ALIGNED): New macro.

* libguile/_scm.h: Include "libguile/strings.h", to make the
  string/stringbuf-related constants visible to snarffed code.

* libguile/snarf.h (SCM_SUPPORT_STATIC_ALLOCATION): New macro.
  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL)[SCM_SUPPORT_STATIC_ALLOCATION]: New
  alternative versions of these macros with support for (almost) static
  allocation via the use of `string->symbol'.
  (SCM_IMMUTABLE_DOUBLE_CELL, SCM_IMMUTABLE_STRINGBUF,
  SCM_IMMUTABLE_STRING): New macros.

* libguile/tags.h (SCM)[SCM_DEBUG_TYPING_STRICTNESS==1]: Use a pointer
  type that is compatible with other pointer types, to avoid potential
  violation of strict aliasing rules.
2009-01-14 00:05:23 +01:00
Ludovic Courtès
450be18dff Handle lack of struct dirent64' and readdir64_r ()' on HP-UX 11.11. 2008-07-17 00:20:31 +02:00
Neil Jerram
fa80e2809e (errno): Remove declarations that have been there
forever, and are known to conflict on some platforms with that
provided by <errno.h>, which we include unconditionally.  If
<errno.h> doesn't provide a errno declaration, what is the point
of it?
2008-02-27 23:00:37 +00:00
Neil Jerram
d05bcb2ede * fports.c (fport_seek): Make dependent on GUILE_USE_64_CALLS.
* _scm.h: Make definition of CHOOSE_LARGEFILE depend on
GUILE_USE_64_CALLS.

* configure.in (--without-64-calls): New option.
2008-02-05 23:14:21 +00:00
Neil Jerram
d3cf93bc25 * srfi-39.scm: Update copyright statement to LGPL.
* __scm.h, _scm.h, weaks.c: Update copyright statement to LGPL.

* compat/compat.h: Update copyright statement to LGPL.

* oldfmt.c: Update copyright statement to LGPL.

* libguile.h: Update copyright statement to LGPL.
2008-01-22 21:06:22 +00:00
Neil Jerram
9a5fa6e98a * configure.in: New check for uca lib (needed for IA64 on HP-UX).
* threads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp() and
scm_ia64_register_backing_store_base() instead of Linux-specific
implementations.

* gc.h (scm_ia64_register_backing_store_base, scm_ia64_ar_bsp):
New declarations.

* gc.c (__libc_ia64_register_backing_store_base): Declaration
removed.
(scm_ia64_register_backing_store_base, scm_ia64_ar_bsp): New, with
implementations for Linux and HP-UX.

* coop-pthreads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp()
and scm_ia64_register_backing_store_base() instead of
Linux-specific implementations.

* continuations.h (__libc_ia64_register_backing_store_base):
Declaration removed.
(scm_t_contregs): New "fresh" field.

* continuations.c (ia64_getcontext): Removed.
(scm_make_continuation): Use continuation fresh field instead of
interpreting getcontext return values (which isn't portable).  Use
scm_ia64_ar_bsp() and scm_ia64_register_backing_store_base()
instead of Linux-specific implementations.
(copy_stack_and_call): Use scm_ia64_register_backing_store_base()
instead of Linux-specific implementation.

* _scm.h (__ia64__): Also detect __ia64.
2006-10-25 22:37:24 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Kevin Ryde
22acb29853 merge from 1.8 branch 2006-06-17 23:41:24 +00:00
Kevin Ryde
b4716c8d4f (scm_to_off_t, scm_from_off_t): No error if unknown off_t
size, to help the guile-readline build where off_t is unused.
2006-04-17 01:23:37 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Rob Browning
17403ebcaf * _scm.h: fix various preprocessor usages of new public symbols to
expect 0 or 1 values rather than 1 or undefined.  i.e. change
#ifdef to #if, etc.
2003-03-27 19:55:45 +00:00
Rob Browning
b49ed9c97f * _scm.h: #include <config.h> if HAVE_CONFIG_H.
Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
2003-03-25 23:52:18 +00:00
Mikael Djurfeldt
9bc4701cd3 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): New macros.
(SCM_CRITICAL_SECTION_START/END): Defined here.

* eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
the three calls to scm_m_expand_body.

* gc.h: #include "libguile/pthread-threads.h";
(SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.

* gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
scm_t_key;

* gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
access.

* gc-freelist.c (scm_gc_init_freelist): Create freelist keys.

* gc-freelist.c, threads.c (really_launch): Use
SCM_FREELIST_CREATE.

* gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):

* gc.c (scm_i_expensive_validation_check, scm_gc,
scm_gc_for_newcell): Put threads to sleep before doing GC-related
heap administration so that those pieces of code are executed
single-threaded.  We might consider rewriting these code sections
in terms of a "call_gc_code_singly_threaded" construct instead of
calling the pair of scm_i_thread_put_to_sleep () and
scm_i_thread_wake_up ().  Also, we would want to have as many of
these sections eleminated.

* init.c (scm_init_guile_1): Call scm_threads_prehistory.

* inline.h: #include "libguile/threads.h"

* pthread-threads.h: Macros now conform more closely to the
pthreads interface.  Some of them now take a second argument.

* threads.c, threads.h: Many changes.

* configure.in: Temporarily replaced "copt" threads option with new
option "pthreads".
(USE_PTHREAD_THREADS): Define if pthreads configured.
2002-12-09 13:42:58 +00:00
Marius Vollmer
3d7f708f21 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
SCM_DEBUG_DEPRECATED.  Removed their use thru-out Guile.
2002-11-03 22:09:20 +00:00
Marius Vollmer
845944c3d9 (HAVE_RESTARTABLE_SYSCALLS): Do define even when
SCM_COPT_THREADS is defined.
(SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
is defined.
2002-11-03 01:01:43 +00:00
Marius Vollmer
cfe062d097 Include <errno.h< so that SCM_SYSCALL is correctly
defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
(HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
is defined.
2002-11-02 01:01:00 +00:00
Han-Wen Nienhuys
34d19ef643 2002-07-20 Han-Wen <hanwen@cs.uu.nl>
* *.c: add space after commas everywhere.

* *.c: use SCM_VECTOR_SET everywhere, where a vector is written.
Document cases where SCM_WRITABLE_VELTS() is used.

* vectors.h (SCM_VELTS): prepare for write barrier, and let
SCM_VELTS() return a const pointer
(SCM_VECTOR_SET): add macro.

* autogen.sh (mscripts): find and check version number of
autoconf. Complain if 2.53 is not found.
2002-07-20 14:08:34 +00:00
Marius Vollmer
0f633e6683 Include "libguile/inline.h". 2001-11-25 15:03:28 +00:00
Dirk Herrmann
0527e68763 * Renamed header macros to the SCM_<filename>_H format. 2001-08-31 10:42:19 +00:00
Martin Grabmüller
82893676f4 Make compilation under Windows easier. 2001-06-26 17:53:09 +00:00
Marius Vollmer
86d31dfe7d Merge from mvo-vcell-cleanup-1-branch. 2001-05-15 14:57:22 +00:00
Mikael Djurfeldt
e6e2e95aa5 * _scm.h: Removed #include <errno.h>.
* error.c, net_db.c, putenv.c, stime.c: Removed declaration of
errno variable (can be a macro on some systems, for example when
using linux libc with threads).

* error.c, filesys.c, gc.c, ioext.c, iselect.c, net_db.c, ports.c,
posix.c, print.c, putenv.c, scmsigs.c, script.c, simpos.c, smob.c,
socket.c, srcprop.c, stime.c, strop.c, unif.c, vports.c: Added
#include <errno.h> in these 20 out of 100 files.
2001-03-10 16:56:09 +00:00
Dirk Herrmann
5610071627 * Makefile.am: Let 'make clean' remove *.x and *.doc files.
* Renamed SCM_STRICT_TYPING to SCM_DEBUG_TYPING_STRICTNESS.
* Removed conditionally compiled code for Turbo C.
* gdbint.c:  Eliminated call to scm_tag.
2000-05-16 12:11:08 +00:00
Mikael Djurfeldt
a059974535 * Makefile.am (DEFS): Added. automake adds -I options to DEFS,
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.

* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
2000-04-21 14:16:44 +00:00
Michael Livshin
89e00824a0 * *.[hc]: add Emacs magic at the end of file, to ensure GNU
indentation style.
2000-03-19 19:01:16 +00:00
Dirk Herrmann
28b3236d36 Only include async.h where it is actually needed. 2000-03-18 09:16:48 +00:00
Dirk Herrmann
ba11fd4cb6 Only include root.h where it is actually needed. 2000-03-18 08:44:04 +00:00
Dirk Herrmann
7ab3fdd51f Only include strings.h where it is actually needed. 2000-03-17 18:11:58 +00:00
Dirk Herrmann
f04d8caf82 Only include ports.h where it is actually needed. 2000-03-17 16:10:13 +00:00
Dirk Herrmann
003d1fd046 Only include vectors.h in those files, where it is actually needed. 2000-03-17 15:23:03 +00:00
Jim Blandy
176067df1a Doc fix. 2000-03-16 21:11:45 +00:00
Gary Houston
08b8c6948d 1999-09-18 Gary Houston <ghouston@freewire.co.uk>
* configure.in: use AC_SYS_RESTARTABLE_SYSCALLS instead of
	testing for SA_RESTART.

1999-09-18  Gary Houston  <ghouston@freewire.co.uk>

	* _scm.h, scmsigs.c: replace HAVE_RESTARTS with
	HAVE_RESTARTABLE_SYSCALLS.
1999-09-18 17:13:38 +00:00
Gary Houston
e1a191a8ca * scmsigs.h, async.h: updated.
* _scm.h: if HAVE_RESTARTS is defined then don't use a SYSCALL
loop.

* posix.c (scm_uname): interpret only negative values as an error.
Solaris normally returns a positive value.

* script.c (scm_compile_shell_switches): if we are not going into
an interactive repl, set scm_mask_ints to zero so that asyncs can
run.

* simpos.c (scm_system):  don't ignore/unignore signals around
the "system" call.

* posix.c (scm_open_pipe): don't ignore/unignore signals around
the "popen" call.

* init.c (scm_boot_guile_1): don't call scm_init_signals, it's
done in boot-9.scm instead.

* scmsigs.c, async.c: Major rewriting of signal handling code.
(scm_sigaction): new procedure.
(scm_sleep): don't wrap sleep in SCM_SYSCALL, it would mess up the
timing.
(scm_raise): return unspecified, throw error on failure.

* boot-9.scm: signal-handler, alarm-thunk: removed.
don't define ticks-interrupt etc.
top-repl: install signal handlers for SIGINT, SIGFPE, SIGSEGV, SIGBUS
during call to scm-style-repl.

* acconfig.h: mention HAVE_RESTARTS.
* configure.in: check for sigaction and restartable system calls.
1997-05-31 19:02:38 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00
Jim Blandy
7bfd3b9e94 Merge threads directory into libguile.
* coop-defs.h, coop-threads.c, coop-threads.h, coop.c, threads.c,
threads.h: New source files.
* Makefile.am (EXTRA_libguile_la_SOURCES): Add threads.c.
(noinst_HEADERS): Add coop-threads.c, coop-threads.h, coop.c
here; see comment.
(modinclude_HEADERS): Add threads.h, coop-defs.h.
(EXTRA_DIST): Add fsu-pthreads.h, mit-pthreads.c, mit-pthreads.h,
coop-threads.c.cygnus, coop-threads.h.cygnus.
* configure.in: If we're using threads, include threads.o in
LIBOBJS.
* _scm.h, libguile.h: threads.h lives in this directory now.
* fsu-pthreads.h, mit-pthreads.c, mit-pthreads.h,
coop-threads.c.cygnus, coop-threads.h.cygnus: New files, not
currently used, but brought along for information's sake.
* ChangeLog-threads: log from old 'threads' directory.
* Makefile.in, configure: Rebuilt.
1997-04-15 01:34:36 +00:00
Mikael Djurfeldt
e412e180d4 * _scm.h: Added #ifndef around definition of macros min and max. 1996-11-02 20:52:58 +00:00
Jim Blandy
5b4215a8b5 * snarf.h: New file.
* guile-snarf.sh: New file.
* Makefile.in (inner_h_files): Added snarf.h
(ancillary, install, uninstall, distclean): Added actions for
guile-snarf.
(.c.x): Use guile-snarf.
(guile-snarf): New rule, to produce guile-snarf from guile-snarf.sh.
(gen_c_files): Note that these depend on guile-snarf.
* _scm.h: Removed the snarfing macros (SCM_PROC, etc). They are
now in "snarf.h".  Added #include "snarf.h" to get them.
* configure.in: Added guile-snarf to AC_OUTPUT
* libguile.h: Added #include "snarf.h".
(Patches applied and tweaked by Jim Blandy.)
1996-10-29 20:49:56 +00:00
Mikael Djurfeldt
462a6f1f0c * _scm.h (min, max): Added.
* async.c: Moved `min' macro to _scm.h.
1996-10-14 03:24:01 +00:00
Jim Blandy
ddef832786 * _scm.h: #include "print.h" here, since it seems to be used just
about everywhere.
* eval.c, gdbint.c, genio.h, numbers.h, smob.h, srcprop.c,
strports.c, unif.h: Don't #include "print.h".
1996-10-03 05:44:52 +00:00
Mikael Djurfeldt
1764973d10 * _scm.h: Added conditional #include "threads.h" 1996-10-01 03:15:33 +00:00