Andy Wingo [Tue, 18 Aug 2009 09:05:17 +0000 (11:05 +0200)]
`load' autocompiles
* libguile/load.h:
* libguile/load.c (scm_sys_warn_autocompilation_enabled): New primitive,
not exported. Since `load' autocompiles now, it should warn in the
same way that the bits hardcoded into C warn.
(scm_try_autocompile): Use scm_sys_warn_autocompilation_enabled.
* module/ice-9/boot-9.scm (autocompiled-file-name): New helper.
(load): Try autocompiling the argument, if appropriate. Will
autocompile files passed on Guile's command line. `primitive-load' is
unaffected.
Ludovic Courtès [Mon, 17 Aug 2009 21:06:49 +0000 (23:06 +0200)]
Thanks, Mike.
Ludovic Courtès [Mon, 17 Aug 2009 21:05:50 +0000 (23:05 +0200)]
Ludovic Courtès [Sat, 15 Aug 2009 12:41:46 +0000 (14:41 +0200)]
Bump version number for 1.9.2.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
Ludovic Courtès [Sat, 15 Aug 2009 12:35:29 +0000 (14:35 +0200)]
Turn off auto-compilation to stand-alone tests.
* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Add
"GUILE_AUTO_COMPILE=0".
Ludovic Courtès [Sat, 15 Aug 2009 12:26:17 +0000 (14:26 +0200)]
Update the manual and `NEWS' regarding `guile-2.0.pc'.
* NEWS: Mention `guile-2.0.pc'.
* doc/ref/autoconf.texi (Autoconf Macros): Update to `guile-2.0'.
Ludovic Courtès [Sat, 15 Aug 2009 10:53:59 +0000 (12:53 +0200)]
Add proper `--help' and `--version' for `guile-tools compile'.
* configure.ac: Produce `meta/guile-tools'.
* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
(bin_SCRIPTS): Remove `guile-tools'.
* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".
* module/scripts/compile.scm (%options): Add `--version'.
(parse-args): Show the offending option name upon error.
(show-version): New.
(compile): Use `%guile-bug-report-address'.
Andy Wingo [Sat, 15 Aug 2009 10:49:44 +0000 (12:49 +0200)]
update NEWS for 1.9.2
* NEWS: Update.
Ludovic Courtès [Sat, 15 Aug 2009 10:06:28 +0000 (12:06 +0200)]
Update `.gitignore' for GNU Global.
Ludovic Courtès [Sat, 15 Aug 2009 10:05:36 +0000 (12:05 +0200)]
Switch from `guile-1.8.pc' to `guile-2.0.pc'.
* configure.ac: Produce guile-2.0*.pc.
* meta/Makefile.am (EXTRA_DIST): Rename guile-1.8*.pc.in to
guile-2.0*.pc.in.
(pkgconfig_DATA): Update accordingly.
* meta/guile-config (guile-module): Likewise.
Ludovic Courtès [Thu, 13 Aug 2009 21:59:51 +0000 (23:59 +0200)]
Uncomment run-time objcode alignment check.
This should now work thanks to the changes in
28b119ee3da0f4b14cb87e638794d22843778cda ("make sure all programs are
8-byte aligned"). This commit is a follow-up to
ec99fe8ecb412e49e8e981246eb62ca46b32754b ("Add FIXMEs about misaligned
objcode-metas.").
* libguile/objcodes.c (scm_c_make_objcode_slice): Uncomment assertion
that checks for proper alignment of PTR.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Update
comment about META's alignment.
Ludovic Courtès [Thu, 13 Aug 2009 21:36:46 +0000 (23:36 +0200)]
Remove deprecated semi-public memoizers.
* libguile/eval.c (scm_m_expand_body, scm_macroexp, scm_unmemocar):
Remove.
(scm_m_undefine): Make `static'.
* libguile/eval.h (scm_m_undefine, scm_m_expand_body, scm_unmemocar,
scm_macroexp): Remove declarations.
Ludovic Courtès [Thu, 13 Aug 2009 21:08:35 +0000 (23:08 +0200)]
Make the evaluator's memoizers private.
* libguile/eval.c (macroexp): Move upwards.
(scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and, scm_m_or,
scm_m_case, scm_m_cond, scm_m_lambda, scm_m_letstar, scm_m_do,
scm_m_quasiquote, scm_m_delay, scm_m_generalized_set_x,
scm_m_define, scm_m_letrec, scm_m_let, scm_m_at, scm_m_atat,
scm_m_apply, scm_m_cont, scm_m_nil_cond, scm_m_atfop,
scm_m_atbind, scm_m_atslot_ref, scm_m_atslot_set_x,
scm_m_at_call_with_values, scm_m_eval_when): New static
declarations; definitions made static.
(s_atslot_ref, s_atslot_set_x): New, from `goops.c'.
* libguile/eval.h (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x,
scm_m_vref, scm_m_vset, scm_m_and, scm_m_or, scm_m_case, scm_m_cond,
scm_m_lambda, scm_m_letstar, scm_m_do, scm_m_quasiquote, scm_m_delay,
scm_m_generalized_set_x, scm_m_future, scm_m_define, scm_m_letrec,
scm_m_let, scm_m_at, scm_m_atat, scm_m_apply, scm_m_cont,
scm_m_nil_cond, scm_m_atfop, scm_m_atbind, scm_m_atslot_ref,
scm_m_atslot_set_x, scm_m_atdispatch, scm_m_at_call_with_values,
scm_m_eval_when): Remove public declarations.
* libguile/goops.c (s_atslot_ref, s_atslot_set_x): Remove.
Ludovic Courtès [Thu, 13 Aug 2009 14:16:08 +0000 (16:16 +0200)]
compiler.test: Enforce evaluation order.
* test-suite/tests/compiler.test ("psyntax")["redefinition", "compile in
current module", "compile in fresh module"]: Use `begin' to enforce
evaluation order. Thanks Andy!
Ludovic Courtès [Wed, 12 Aug 2009 17:22:19 +0000 (19:22 +0200)]
Allow fresh modules to be passed to `compile'.
* module/ice-9/boot-9.scm (module-name): When making MOD non-anonymous,
bind it in the `(%app modules)' name space.
* test-suite/tests/compiler.test ("psyntax")["compile in current
module", "compile in fresh module"]: New tests.
* test-suite/tests/modules.test ("foundations")["modules don't remain
anonymous"]: New test.
Ludovic Courtès [Thu, 13 Aug 2009 13:39:12 +0000 (15:39 +0200)]
Allow redefinitions in compiled code as in `(define round round)'.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/psyntax.scm (chi-top)[define-form]: If a same-named
imported variable exists, take its value instead of `#f'.
* test-suite/tests/compiler.test ("psyntax")["redefinition"]: New tests.
Andy Wingo [Wed, 12 Aug 2009 21:38:05 +0000 (23:38 +0200)]
update docs for recent vm/compiler work
* doc/ref/compiler.texi:
* doc/ref/vm.texi: Update for recent changes.
* module/language/assembly/disassemble.scm (disassemble-load-program):
Don't print nops, they are distracting.
Andy Wingo [Wed, 12 Aug 2009 18:44:30 +0000 (20:44 +0200)]
"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.
Michael Gran [Wed, 12 Aug 2009 15:30:59 +0000 (08:30 -0700)]
Don't include libunistring headers in Guile public headers
This requres the creation of a new type
scm_t_string_failed_conversion_handler to replace libunistring's
enum iconveh_ilseq_handler.
* libguile/strings.h: don't include <uniconv.h>
(scm_t_string_failed_conversion_handler): new enum type
(SCM_FAILED_CONVERSION_ERROR, SCM_FAILED_CONVERSION_QUESTION_MARK):
(SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE): new enum type values
* libguile/strings.c (scm_to_stringn): now takes type
scm_t_string_failed_conversion_handler. All callers changed.
* libguile/print.c: include <uniconv.h>
* libguile/ports.c (scm_lfwrite_substr): use
scm_t_string_conversion_handler's constants
* libguile/gen-scmconfig.c (SCM_ICONVEH_ERROR):
(SCM_ICONVEH_QUESTION_MARK, SCM_ICONVEH_ESCAPE_SEQUENCE): store
iconveh_ilseq_hander constants as #define's
Michael Gran [Wed, 12 Aug 2009 16:21:37 +0000 (09:21 -0700)]
Regression, scm_string fails to test for circular lists
* libguile/string.c (scm_string): Restores the functionality
where scm_string tests for circular lists
* test-suite/tests/strings.test: add test for circular lists
Michael Gran [Wed, 12 Aug 2009 15:50:12 +0000 (08:50 -0700)]
Some signed/unsigned comparison and conversions
* libguile/ports.c (scm_lfwrite_str, scm_lfwrite_substr): signed/unsigned
conversion and comparison
* libguile/strings.c (scm_string_append): signed/unsigned comparison
Andy Wingo [Wed, 12 Aug 2009 14:33:49 +0000 (16:33 +0200)]
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.
Michael Gran [Wed, 12 Aug 2009 07:26:12 +0000 (00:26 -0700)]
Fix disassembly of strings and symbols
* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
fix disassembly of strings, symbols, keywords, and defines
Michael Gran [Wed, 12 Aug 2009 05:52:49 +0000 (22:52 -0700)]
Quiet signed/unsigned comparison warnings in chars.[ch]
* libguile/chars.h (SCM_MAKE_CHAR): quiet signed/unsigned
comparison warnings
* libguile/chars.c (scm_i_charname):
(scm_i_charname_to_char): quiet signed/unsigned comparison
warnings
Michael Gran [Wed, 12 Aug 2009 05:01:20 +0000 (22:01 -0700)]
Avoid unitialized and unused warnings in scm_string_append
* libguile/strings.c (scm_string_append): avoid warnings
Michael Gran [Wed, 12 Aug 2009 04:27:20 +0000 (21:27 -0700)]
Revert to locale-dependent toupper and tolower
To avoid leaving Guile in a broken state, the conversion
from locale-dependent case modification to Unicode case modification
should be an atomic commit
* libguile/chars.c (scm_c_upcase): revert to locale-dependent
toupper and tolower
Michael Gran [Wed, 12 Aug 2009 04:12:52 +0000 (21:12 -0700)]
Only pass ints to tolower and toupper
* libguile/strings.c (unistring_escapes_to_guile_escapes): cast
tolower's parameter to int
* libguile/read.c (CHAR_DOWNCASE): cast tolower's parameter to int
Andy Wingo [Tue, 11 Aug 2009 22:14:44 +0000 (00:14 +0200)]
debitrot the ecmascript compiler
* module/Makefile.am (ECMASCRIPT_LANG_SOURCES):
* module/language/ecmascript/compile-ghil.scm:
* module/language/ecmascript/compile-tree-il.scm: SOURCES): Replace the
GHIL compiler with a ->tree-il compiler. Not fully functional, but the
basics work.
* module/language/ecmascript/spec.scm: Only include the tree-il compiler.
* module/language/ecmascript/tokenize.scm (read-punctuation): Avoid
mutating a constant.
Andy Wingo [Tue, 11 Aug 2009 19:16:05 +0000 (21:16 +0200)]
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.
Andy Wingo [Tue, 11 Aug 2009 18:25:19 +0000 (20:25 +0200)]
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.
Michael Gran [Tue, 11 Aug 2009 05:55:29 +0000 (22:55 -0700)]
More string and symbol tests
* test-suite/tests/strings.test: more tests
* test-suite/tests/symbols.test: more tests
Michael Gran [Tue, 11 Aug 2009 05:18:47 +0000 (22:18 -0700)]
Fix %string-dump and %symbol-dump fields
* libguile/strings.c (scm_sys_string_dump): don't print
stringbuf. Print read-only status.
(scm_sys_symbol_dump): don't print stringbuf. Print interned
status.
Ludovic Courtès [Mon, 10 Aug 2009 17:24:34 +0000 (19:24 +0200)]
Change `defined?' to accept a module as its second argument.
Reported by Daniel Kraft <d@domob.eu>.
* doc/ref/api-binding.texi (Binding Reflection): Update documentation of
`defined?'.
* libguile/evalext.c (scm_defined_p): Expect a module as the second
argument, not a lexical environment.
Michael Gran [Mon, 10 Aug 2009 12:51:05 +0000 (05:51 -0700)]
Make scm_charprint and scm_i_string_wide_chars SCM_INTERNAL.
Also, scm_charprint is renamed to scm_i_charprint.
* libguile/strings.h: make scm_i_string_wide_chars internal.
* libguile/print.h: rename scm_charprint to scm_i_charprint. Make
internal.
* libguile/print.c (scm_i_charprint): renamed from scm_charprint
(scm_charprint): renamed to scm_i_charprint. All callers changed.
Michael Gran [Mon, 10 Aug 2009 07:09:33 +0000 (00:09 -0700)]
Improve %string-dump and %symbol-dump
%string-dump and %symbol-dump are modified to return assocation lists
of string and symbol attributes instead of printing to stderr. They
are no longer conditional on SCM_DEBUG.
* libguile/strings.c (scm_sys_string_dump)
(scm_sys_symbol_dump): now returns alist of properties. No longer
require that SCM_DEBUG be defined.
(scm_sys_stringbuf_hist): now conditional on
SCM_STRING_LENGTH_HISTOGRAM
* libguile/strings.h: scm_sys_string_dump and scm_sys_symbol dump
are now declared as API
Michael Gran [Mon, 10 Aug 2009 01:06:59 +0000 (18:06 -0700)]
More comments for string functions
* libguile/strings.c: comments
Michael Gran [Sun, 9 Aug 2009 23:01:20 +0000 (16:01 -0700)]
Missing parentheses in SCM_MAKE_CHAR macro
* libguile/chars.h (SCM_MAKE_CHAR): missing parentheses
Michael Gran [Sun, 9 Aug 2009 22:58:49 +0000 (15:58 -0700)]
Port position macros shouldn't require enclosing braces
The port position macros incorrectly required enclosing braces
when used within if statements.
* libguile/ports.h (SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
(SCM_DECCOL, SCM_TABCOL): enclose macro in do/while
* libguile/ports.c (update_port_lf): remove extra braces
Ludovic Courtès [Sun, 9 Aug 2009 21:40:11 +0000 (23:40 +0200)]
Use a linker version script for libguile.
* libguile/Makefile.am (libguile_la_LDFLAGS)[HAVE_LD_VERSION_SCRIPT]:
Use `libguile.map'.
(EXTRA_DIST): Add `libguile.map'.
* libguile/libguile.map: New file.
Ludovic Courtès [Sun, 9 Aug 2009 21:05:37 +0000 (23:05 +0200)]
Use Gnulib's `lib-symbol-versions' module.
* m4/gnulib-cache.m4: Add `lib-symbol-versions'.
Ludovic Courtès [Sun, 9 Aug 2009 18:21:41 +0000 (20:21 +0200)]
Remove bogus `configure' test for GNU libunistring.
* configure.ac: Remove explicit test for libunistring, which conflicted
with Gnulib's own test. This fixes commit
f4863880f5ef539cb545999c19b6b5c0eec9382d.
Michael Gran [Sat, 8 Aug 2009 09:35:08 +0000 (02:35 -0700)]
Merge commit 'origin/master'
Michael Gran [Sat, 8 Aug 2009 09:35:00 +0000 (02:35 -0700)]
Add Unicode strings and symbols
This adds full Unicode strings as a datatype, and it adds some
minimal functionality. The terminal and port encoding is assumed
to be ISO-8859-1. Non-ISO-8859-1 characters are written or
input as string character escapes.
The string character escapes now have 3 forms: \xXX \uXXXX and
\UXXXXXX, for unprintable characters that have 2, 4 or 6 hex digits.
The process for writing to strings has been modified. There is now a
function scm_i_string_start_writing that does the copy-on-write
conversion if necessary.
To compile strings that may be wide, the VM storage of strings and
string-likes has changed.
Most string-using functions have not yet been updated and may break
when used with wide strings.
* module/language/assembly/compile-bytecode.scm (write-bytecode):
use variable width string bytecode format
* module/language/assembly.scm (byte-length): use variable width
bytecode format
* libguile/vm-i-loader.c (load-string, load-symbol):
(load-keyword, define): use variable-width bytecode format
* libguile/vm-engine.h (FETCH_WIDTH): new macro
* libguile/strings.h: new declarations
* libguile/strings.c (make_wide_stringbuf): new function
(widen_stringbuf): new function
(scm_i_make_wide_string): new function
(scm_i_is_narrow_string): new function
(scm_i_string_wide_chars): new function
(scm_i_string_start_writing): new function
(scm_i_string_ref): new function
(scm_i_string_set_x): new function
(scm_i_is_narrow_symbol): new function
(scm_i_symbol_wide_chars, scm_i_symbol_ref): new function
(scm_string_width): new function
(unistring_escapes_to_guile_escapes): new function
(scm_to_stringn): new function
(scm_i_stringbuf_free): modify for wide strings
(scm_i_substring_copy): modify for wide strings
(scm_i_string_chars, scm_string_append): modify for wide strings
(scm_i_make_symbol, scm_to_locale_stringn): modify for wide strings
(scm_string_dump, scm_symbol_dump, scm_to_locale_stringbuf):
(scm_string, scm_i_deprecated_string_chars): modify for wide strings
(scm_from_locale_string, scm_from_locale_stringn): add null test
* libguile/srfi-13.c: add calls for scm_i_string_start_writing for
each call of scm_i_string_stop_writing
(scm_string_for_each): modify for wide strings
* libguile/socket.c: add calls for scm_i_string_start_writing for each
call of scm_i_string_stop_writing
* libguile/rw.c: add calls for scm_i_string_start_writing for each
call of scm_i_string_stop_writing
* libguile/read.c (scm_read_string): allow reading of wide strings
* libguile/print.h: add declaration for scm_charprint
* libguile/print.c (iprin1): print wide strings and add new string
escapes
(scm_charprint): new function
* libguile/ports.h: new declarations for scm_lfwrite_substr and
scm_lfwrite_str
* libguile/ports.c (update_port_lf): new function
(scm_lfwrite): use update_port_lf
(scm_lfwrite_substr): new function
(scm_lfwrite_str): new function
* test-suite/tests/asm-to-bytecode.test ("compiler"): add string
width byte to sting-like asm tests
Andy Wingo [Fri, 7 Aug 2009 17:06:15 +0000 (19:06 +0200)]
lambda, the ultimate goto
* module/language/tree-il/analyze.scm (analyze-lexicals): Rework to
actually determine when a fixed-point procedure may be allocated as a
label.
* module/language/tree-il/compile-glil.scm (emit-bindings): Always emit
a <glil-bind>. Otherwise it's too hard to pair with unbindings.
(flatten-lambda): Consequently, here we only `bind' if there are any
vars to bind. This doesn't make any difference, given that lambdas
don't have trailing unbind instructions, but it does keep the GLIL
output the same for thunks -- no extraneous (bind) instructions. Keeps
tree-il.test happy.
(flatten): Some bugfixes. Yaaay, it works!!!
Andy Wingo [Fri, 7 Aug 2009 15:44:02 +0000 (17:44 +0200)]
implement compilation of label-allocated lambda expressions
* module/language/tree-il/compile-glil.scm (flatten-lambda, flatten):
Implement compilation of label-allocated lambda expressions. Quite
tricky, we'll see if this works when the new analyzer lands.
Andy Wingo [Fri, 7 Aug 2009 13:35:53 +0000 (15:35 +0200)]
add label alist to lambda allocations in tree-il->glil compiler
* module/language/tree-il/analyze.scm: Add some more comments about
something that will land in a future commit: compiling fixpoint
lambdas as labels.
(analyze-lexicals): Reorder a bit, and add a label alist to procedure
allocations. Empty for now.
* module/language/tree-il/compile-glil.scm (flatten): Adapt to the free
variables being in the cddr of the allocation, not the cdr.
Andy Wingo [Thu, 6 Aug 2009 15:46:38 +0000 (17:46 +0200)]
loop detection in the house
* libguile/vm-i-scheme.c (vector-ref, vector-set): Sync registers if we
call out to C.
* module/language/tree-il/compile-glil.scm (flatten-lambda): Add an
extra argument, the self-label, which should be the gensym under which
the procedure is bound in a <fix> expression.
(flatten): If we see a call to a lexical ref to the self-label in a
tail position, rename and goto instead of goto/args, which will tear
down the frame -- or will, in the future. It's a primitive form of
loop detection.
* module/language/tree-il/primitives.scm (zero?): Expand to (= x 0).
Andy Wingo [Thu, 6 Aug 2009 14:01:24 +0000 (16:01 +0200)]
actually implement "fixing letrec"
* module/Makefile.am (SOURCES): Reorganize so GHIL is compiled last,
along with ecmascript.
* module/language/scheme/spec.scm: Remove references to GHIL, as it's
bitrotten and obsolete..
* module/language/tree-il.scm (make-tree-il-folder): Rework so that we
only have down and up procs, and call down and up on each element.
* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a thinko
handling let-values.
* module/language/tree-il/fix-letrec.scm: Actually implement fixing
letrec. The resulting code will perform better, but violations of the
letrec restriction are not detected. This behavior is allowed by the
spec, but it is undesirable. Perhaps that will be fixed later.
* module/language/tree-il/inline.scm (inline!): Fix a case in which
((lambda args foo)) would be erroneously inlined to foo. Remove empty
let, letrec, and fix statements.
* module/language/tree-il/primitives.scm (effect-free-primitive?): New
public predicate.
Andy Wingo [Thu, 6 Aug 2009 09:48:16 +0000 (11:48 +0200)]
actually inline call-with-values to tree-il's <let-values>
* module/srfi/srfi-11.scm (let-values): In the one-clause case, avoid
going through temporary variables.
* module/language/tree-il/inline.scm (inline!): Add another case:
(call-with-values (lambda () ...) (lambda ... ...) -> let-values.
* module/language/tree-il/compile-glil.scm (flatten): Fix a bug
compiling applications in "vals" context.
* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a couple
bugs with let-values and rest arguments.
Andy Wingo [Wed, 5 Aug 2009 19:25:35 +0000 (21:25 +0200)]
let-values in terms of syntax-case, add make-tree-il-folder
* module/language/tree-il.scm (tree-il-fold): Fix for let-values case.
(make-tree-il-folder): New public macro, makes a multi-valued folder
specific to the number of seeds that the user wants.
* module/language/tree-il/optimize.scm (optimize!): Reverse the order of
inline! and fix-letrec!, as the latter might expose opportunities for
the former.
* module/srfi/srfi-11.scm (let-values): Reimplement in terms of
syntax-case, so that its expressions may reference hygienically bound
variables. See the NEWS for the rationale.
(let*-values): An empty let*-values still introduces a local `let'
binding contour.
* module/system/base/syntax.scm (record-case): Yukkkk. Reimplement in
terms of syntax-case. Ug-ly, but see the NEWS again: "Lexical bindings
introduced by hygienic macros may not be referenced by nonhygienic
macros."
Andy Wingo [Wed, 5 Aug 2009 15:51:40 +0000 (17:51 +0200)]
add <fix> tree-il construct, and compile it
* libguile/vm-i-system.c (fix-closure): New instruction, for wiring
together fixpoint procedures.
* module/Makefile.am (TREE_IL_LANG_SOURCES): Add fix-letrec.scm.
* module/language/glil/compile-assembly.scm (glil->assembly): Reindent
the <glil-lexical> case, and handle 'fix for locally-bound vars.
* module/language/tree-il.scm (<fix>): Add the <fix> tree-il type and
accessors, for fixed-point bindings. This IL construct is taken from
the Waddell paper.
(parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
(pre-order!, post-order!): Update for <fix>.
* module/language/tree-il/analyze.scm (analyze-lexicals): Update for
<fix>. The difference here is that the bindings may not be assigned,
and are not marked as such. They are not boxed.
(report-unused-variables): Update for <fix>.
* module/language/tree-il/compile-glil.scm (flatten): Compile <fix> to
GLIL.
* module/language/tree-il/fix-letrec.scm: A stub implementation of
fixing letrec -- will flesh out in a separate commit.
* module/language/tree-il/inline.scm: Fix license, it was mistakenly
added with LGPL v2.1+.
* module/language/tree-il/optimize.scm (optimize!): Run the fix-letrec!
pass.
Andy Wingo [Wed, 5 Aug 2009 14:17:20 +0000 (16:17 +0200)]
add a brain-dead inliner
* module/Makefile.am (TREE_IL_LANG_SOURCES):
* module/language/tree-il/inline.scm: Add a brain-dead inliner, to
inline ((lambda () x)) => x.
* module/language/tree-il/optimize.scm (optimize!): Invoke the inliner.
Andy Wingo [Wed, 5 Aug 2009 09:55:42 +0000 (11:55 +0200)]
add1 and sub1 instructions
* libguile/vm-i-scheme.c: Add add1 and sub1 instructions.
* module/language/tree-il/compile-glil.scm: Compile 1+ and 1- to add1
and sub1.
* module/language/tree-il/primitives.scm (define-primitive-expander):
Add support for `if' statements in the consequent.
(+, -): Compile (- x 1), (+ x 1), and (+ 1 x) to 1- or 1+ as
appropriate.
(1-): Remove this one. Seems we forgot 1+ before, but we weren't
compiling it nicely anyway.
* test-suite/tests/tree-il.test ("void"): Fix expected compilation of (+
(void) 1) to allow for add1.
Andy Wingo [Tue, 4 Aug 2009 19:16:32 +0000 (21:16 +0200)]
perform gmp/unistring compile checks with AC_LIB_HAVE_LINKFLAGS
* configure.ac: Rework gmp and unistring checks to use
AC_LIB_HAVE_LINKFLAGS, so that the compilation checks run with the
right -L/-l flags.
* libguile/Makefile.am (libguile_la_LIBADD): Adapt to need to add
$(LIBGMP) and $(LIBUNISTRING) here.
Hopefully this solves
http://article.gmane.org/gmane.lisp.guile.bugs/4288.
Andy Wingo [Tue, 4 Aug 2009 18:46:20 +0000 (20:46 +0200)]
rename configure.in to configure.ac
* configure.ac:
* guile-readline/configure.ac: Rename from configure.in, as recommended
by the autoconf manual.
Andy Wingo [Tue, 4 Aug 2009 18:29:09 +0000 (20:29 +0200)]
fix buffer overrun reading partial numbers: 1.0f, 1.0/, and 1.0+
* libguile/numbers.c (mem2decimal_from_point, mem2ureal, mem2complex):
Fix a number of cases where, for invalid numbers, we could read past
the end of the buffer. This happened in e.g. "1.0+", "1/" and "1.0f".
But I couldn't figure out how to test for these, given that the
behavior depended on the contents of uninitialized memory in the
reader buffer. We'll just have to be happy with this.
Thanks to Kjetil S. Matheussen for the report.
Michael Gran [Sat, 1 Aug 2009 18:21:46 +0000 (11:21 -0700)]
Don't doubly define scm_t_wchar
* libguile/chars.h: don't define scm_t_wchar
* libguile/numbers.h: define scm_t_wchar here
Michael Gran [Sat, 1 Aug 2009 18:04:43 +0000 (11:04 -0700)]
Fix coding style compliance for recent 32-bit char changes
* libguile/print.c (iprin1): extra braces
* libguile/chars.h (SCM_IS_UNICODE_CHAR): coding style
Michael Gran [Sat, 1 Aug 2009 17:15:20 +0000 (10:15 -0700)]
Don't use GNU extensions for SCM_MAKE_CHAR macro
Since the contents of SCM_MAKE_CHAR are evaluated more than once,
don't use it in situations where this could cause side-effects.
* libguile/vm-i-system.c (make-char8): avoid side-effects with
SCM_MAKE_CHAR call
* libguile/chars.h (SCM_MAKE_CHAR): modified
Michael Gran [Sat, 1 Aug 2009 15:12:15 +0000 (08:12 -0700)]
Make charname declarations module-level and GCS
Charname array declarations are corrected for style and
are made module-level. Array list length variables are
replaced with macros.
* libguile/chars.c: variable declaration fixes
Michael Gran [Sat, 1 Aug 2009 15:05:55 +0000 (08:05 -0700)]
Update NEWS for charname changes
* NEWS: updated
Ludovic Courtès [Thu, 30 Jul 2009 22:42:58 +0000 (00:42 +0200)]
Add unused variable analysis in the tree-il->glil compiler.
* module/language/tree-il/analyze.scm (<binding-info>): New record type.
(report-unused-variables): New procedure.
* module/language/tree-il/compile-glil.scm (%warning-passes): New
variable.
(compile-glil): Honor `#:warnings' from OPTS.
* test-suite/tests/tree-il.test (call-with-warnings): New procedure.
(%opts-w-unused): New variable.
("warnings"): New test prefix.
Ludovic Courtès [Thu, 30 Jul 2009 22:06:59 +0000 (00:06 +0200)]
Add `(system base message)', a simple warning framework.
* module/Makefile.am (SOURCES): Add `system/base/message.scm'.
* module/scripts/compile.scm (%options): Add `--warn'.
(parse-args): Update default value for `warnings'.
(show-warning-help): New procedure.
(compile)[compile-opts]: Add `#:warnings'.
Update help message.
* module/system/base/compile.scm (compile): Sanity-check the requested
warnings.
* module/system/base/message.scm: New file.
Ludovic Courtès [Wed, 29 Jul 2009 22:48:04 +0000 (00:48 +0200)]
Add `tree-il-fold', a purely functional iterator on `tree-il'.
* module/language/tree-il.scm (tree-il-fold): New procedure.
* test-suite/tests/tree-il.test ("tree-il-fold"): New test prefix.
Michael Gran [Wed, 29 Jul 2009 13:38:32 +0000 (06:38 -0700)]
Add 32-bit characters
This adds the 32-bit standalone characters. Strings are still
8-bit. Characters larger than 8-bit can only be entered or
displayed in octal format at this point. At this point, the
terminal's display encoding is expected to be Latin-1.
* module/language/assembly/compile-bytecode.scm (write-bytecode):
add 32-bit char
* module/language/assembly.scm (object->assembly): add 32-bit char
(assembly->object): add 32-bit char
* libguile/vm-i-system.c (make-char32): new op
* libguile/print.c (iprin1): print 32-bit char
* libguile/numbers.h: add type scm_t_wchar
* libguile/numbers.c: add type scm_t_wchar
* libguile/chars.h: new type scm_t_wchar
(SCM_CODEPOINT_MAX): new
(SCM_IS_UNICODE_CHAR): new
(SCM_MAKE_CHAR): operate on 32-bit char
* libguile/chars.c: comparison operators now use Unicode
codepoints
(scm_c_upcase): now receives and returns scm_t_wchar
(scm_c_downcase): now receives and returns scm_t_wchar
Michael Gran [Tue, 28 Jul 2009 04:02:23 +0000 (21:02 -0700)]
Replace global charnames variables with accessors
The global variables scm_charnames and scm_charnums are replaced with
the accessor functions scm_i_charname and scm_i_charname_to_num.
Also, the incomplete and broken EBCDIC support is removed.
* libguile/print.c (iprin1): use new func scm_i_charname
* libguile/read.c (scm_read_character): use new func
scm_i_charname_to_num
* libguile/chars.c (scm_i_charname): new function
(scm_i_charname_to_char): new function
(scm_charnames, scm_charnums): removed
* libguile/chars.h: new declarations
Andy Wingo [Sun, 26 Jul 2009 12:01:56 +0000 (14:01 +0200)]
increase range of relative jumps by aligning blocks to 8-byte boundaries
* libguile/objcodes.c (OBJCODE_COOKIE): Bump again, as our jump offsets
are now multiplied by 8.
* libguile/vm-i-system.c (BR): Interpret the 16-bit offset as a relative
jump to the nearest 8-byte-aligned block -- increasing relative jump
range from +/-32K to +/-240K.
(mvra): Do the same for the mvra jump.
* libguile/vm.c (really_make_boot_program): Align the mvra.
* module/language/assembly.scm (align-block): New export, for aligning
blocks.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Emit
jumps to the nearest 8-byte-aligned block. Effectively our range is 18
bits in either direction. I would like to do this differently -- have
long-br and long-br-if, and all the other br instructions go to 8 bits
only. But the assembler doesn't have an appropriate representation to
allow me to do this yet, so for now this is what we have.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
Decode the 19-bit jumps.
Andy Wingo [Sun, 26 Jul 2009 10:56:11 +0000 (12:56 +0200)]
make sure all programs are 8-byte aligned
* libguile/objcodes.c (OBJCODE_COOKIE): Bump objcode cookie, as we added
to struct scm_objcode.
* libguile/objcodes.h (struct scm_objcode): Add a uint32 after metalen
and before base, so that if the structure has 8-byte alignment, base
will have 8-byte alignment too. (Before, base was 12 bytes from the
start of the structure, now it's 16 bytes.)
* libguile/vm-engine.h (ASSERT_ALIGNED_PROCEDURE): Add a check that can
be turned on with VM_ENABLE_PARANOID_ASSERTIONS.
(CACHE_PROGRAM): Call ASSERT_ALIGNED_PROCEDURE.
* libguile/vm-i-system.c (long-local-ref): Add a missing semicolon.
* libguile/vm.c (really_make_boot_program): Rework to operate directly
on a malloc'd buffer, so that the program will be 8-byte aligned.
* module/language/assembly.scm (*program-header-len*): Add another 4 for
the padding.
(object->assembly): Fix case in which we would return (make-int8 0)
instead of (make-int8:0). This would throw off compile-assembly.scm's
use of addr+.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
out the padding int.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
And pop off the padding int too.
* module/language/glil/compile-assembly.scm (glil->assembly): Don't pack
the assembly, assume that assembly.scm has done it for us. If a
program has a meta, pad out the program so that meta will be aligned.
* test-suite/tests/asm-to-bytecode.test: Adapt to expect programs to
have the extra 4-byte padding int.
Andy Wingo [Sun, 26 Jul 2009 09:54:05 +0000 (11:54 +0200)]
fix alignment of subprograms of subprograms
* module/language/glil/compile-assembly.scm (glil->assembly)
(dump-object): Fix an exciting bug! Subprograms of subprograms were
not being aligned correctly, because the code was generated too early.
So instead delay dumping the object table until the proper time.
Andy Wingo [Sun, 26 Jul 2009 09:21:18 +0000 (11:21 +0200)]
fix unused SCM_FRAME_SET_DYNAMIC_LINK macro
* libguile/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): Fix for new stack
layout, though this macro is not used.
Andy Wingo [Sun, 26 Jul 2009 09:20:39 +0000 (11:20 +0200)]
fix vmstack gdb macro for new stack frame layout
* gdbinit (vmstack): No more external link.
Andy Wingo [Fri, 24 Jul 2009 10:06:40 +0000 (12:06 +0200)]
check that jumps are within the range of a signed 16-bit int
* module/language/assembly/compile-bytecode.scm (write-bytecode): Check
that the offset is within the range of a signed int16 value.
Andy Wingo [Fri, 24 Jul 2009 10:06:19 +0000 (12:06 +0200)]
fix gensym creation in psyntax
* module/ice-9/psyntax.scm (build-lexical-var): Make our gensyms really
unique. Before, there was a chance that different lexicals could
result in the same gensym.
* module/ice-9/psyntax-pp.scm: Regenerate.
Andy Wingo [Fri, 24 Jul 2009 10:05:54 +0000 (12:05 +0200)]
increase default stack size to 64 kilowords
* libguile/vm.c (VM_DEFAULT_STACK_SIZE): Increase to 64 kilowords.
Really, we should simply add overflow handlers, but in the meantime,
this will do.
Andy Wingo [Fri, 24 Jul 2009 09:00:32 +0000 (11:00 +0200)]
compiler support for nlocs >= 256
* libguile/vm-i-system.c (long-local-ref, long-local-set)
(make-variable): New intructions, for handling nlocs >= 256.
* module/language/glil/compile-assembly.scm (glil->assembly): Compile
<glil-lexical> with support for nlocs >= 256.
Andy Wingo [Fri, 24 Jul 2009 08:12:01 +0000 (10:12 +0200)]
nlocs is now 16 bits wide
* libguile/objcodes.h (struct scm_objcode): Remove the "unused" field --
the old "nexts" -- and expand nlocs to 16 bits.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
the nlocs as a uint16.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
Decompile 16-bit nlocs. It seems this decompilation is little-endian
:-/
* test-suite/tests/asm-to-bytecode.test: Fix up to understand nlocs as a
little-endian value. The test does the right thing regarding
endianness.
Andy Wingo [Thu, 23 Jul 2009 14:50:47 +0000 (16:50 +0200)]
remove all mentions of "external" from the compiler and related code
With this, GHIL is effectively bitrotten. I need to port the ECMAScript
compiler to tree-il, then I'll remove it.
* module/language/assembly.scm (byte-length):
* module/language/assembly/compile-bytecode.scm (write-bytecode):
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
* module/language/assembly/disassemble.scm (disassemble-load-program):
(disassemble-free-vars, code-annotation):
* module/language/glil.scm (<glil-program>, <glil-local>)
(<glil-exteral>, parse-glil, unparse-glil):
* module/language/glil/compile-assembly.scm (make-meta):
(compile-assembly, glil->assembly):
* module/language/glil/decompile-assembly.scm (decompile-toplevel):
(decompile-load-program):
* module/language/objcode/spec.scm (decompile-value):
* module/language/tree-il/compile-glil.scm (flatten-lambda):
* module/system/vm/frame.scm (frame-binding-ref):
(frame-binding-set!):
* module/system/vm/program.scm (binding:boxed?):
* module/system/vm/trace.scm (trace-next):
* test-suite/tests/asm-to-bytecode.test ("compiler"):
* test-suite/tests/tree-il.test: Remove all mentions of "external", and
of <glil-local>. Docs updates will come soon.
Andy Wingo [Thu, 23 Jul 2009 12:36:22 +0000 (14:36 +0200)]
rename "closure-ref" to "free-ref"; s/vars/variables/ in some names
* libguile/programs.h:
* libguile/programs.c: (SCM_PROGRAM_FREE_VARIABLES): Rename from
SCM_PROGRAM_FREE_VARS. Callers changed.
* libguile/programs.c (scm_make_program): Rename arg to
"free_variables".
(scm_program_free_variables): Rename from program-free-vars.
* libguile/vm-engine.h:
* libguile/vm-engine.c (VM_CHECK_FREE_VARIABLES): Rename from
VM_CHECK_CLOSURE.
(vm_engine, CACHE_PROGRAM): Rename closure and closure_count to free_vars and
free_vars_vount.
* libguile/vm-i-system.c (FREE_VARIABLE_REF): Rename from CLOSURE_REF.
(free-ref, free-boxed-ref, free-boxed-set): Rename from closure-ref,
closure-boxed-ref, closure-boxed-set.
(make-closure): Renamed from make-closure2.
* module/language/glil/compile-assembly.scm (glil->assembly): Hack to
never write out the the old "make-closure" instruction. Will fix
better later. Change to emit free-ref etc instead of closure-ref.
* module/language/tree-il/compile-glil.scm (flatten): Emit make-closure
instead of make-closure2, now that the old make-closure is gone.
* module/system/vm/program.scm (system): Rename program-free-vars to
program-free-variables.
* test-suite/tests/tree-il.test ("lambda"): Update for make-closure.
Andy Wingo [Thu, 23 Jul 2009 15:12:10 +0000 (17:12 +0200)]
remove "externals" from the vm
* libguile/frames.c (scm_frame_external_link): Removed.
* libguile/frames.h: No need to have the "external link" in the stack
frame -- update macros to take the new situation into account.
* libguile/objcodes.h (struct scm_objcode): Rename the nexts field to
"unused". In the future we can use it for nlocs, I think.
(SCM_OBJCODE_NEXTS): removed.
* libguile/programs.h:
* libguile/programs.c (scm_make_program): Expect the third argument to
be a vector of free variables, not a list of free variables.
SCM_BOOL_F indicates no free variables, not SCM_EOL.
(program_mark): Adapt.
(scm_program_arity): No more nexts.
(scm_program_free_vars): Replaces scm_program_externals.
* libguile/vm-engine.c (VM_CHECK_EXTERNAL)
(vm_engine): No need for the "external" var.
* libguile/vm-engine.h (CACHE_PROGRAM): Update for SCM_PROGRAM_FREE_VARS
instead of SCM_PROGRAM_EXTERNALS.
(NEW_FRAME): Update for new frame size, and no need to cons up
externals. Yay :)
* libguile/vm-i-loader.c (load-program): Update for scm_make_program.
* libguile/vm-i-system.c (external-ref, external-set): No more.
(make-closure): No more.
(goto/args): No need to re-cons externals here. Update for new stack
frame size.
(mv-call, return, return/values): Update for new frame size. No need
to reinstate externals on return.
* libguile/vm.c (really_make_boot_program, scm_load_compiled_with_vm):
Update for scm_make_program.
* module/language/objcode/spec.scm (objcode-env-externals): Treat '() as
#f, for the externals. Need to clean this up later...
* module/system/vm/program.scm (arity:nexts): Remove. Rename
program-external to program-free-vars.
Andy Wingo [Thu, 23 Jul 2009 15:00:56 +0000 (17:00 +0200)]
compile lexical variable access and closure creation to the new ops
* module/language/glil.scm (<glil>): New GLIL type, <glil-lexical>,
which will subsume other lexical types.
* module/language/glil/compile-assembly.scm: Compile <glil-lexical>.
(make-open-binding): Change the interpretation of the second argument
-- instead of indicating an "external" var, it now indicates a boxed
var.
(open-binding): Adapt to new glil-bind format.
* module/language/tree-il/analyze.scm: Add a lot more docs.
(analyze-lexicals): Change the allocation algorithm and output format
to allow the tree-il->glil compiler to capture free variables
appropriately and to reference bound variables in boxes if necessary.
Amply documented.
* module/language/tree-il/compile-glil.scm (compile-glil): Compile
lexical variable access to <glil-lexical>. Emit variable capture and
closure creation code here, instead of leaving that task to the
GLIL->assembly compiler.
* test-suite/tests/tree-il.test: Update expected code emission.
Andy Wingo [Sun, 19 Jul 2009 17:48:26 +0000 (19:48 +0200)]
vm support for display closures
* libguile/vm-i-system.c (box, empty-box): Boxing values and storing
them in local variables.
(local-boxed-ref, local-boxed-set): A combination of local-ref then
variable-ref/set.
(make-closure2, closure-ref, closure-boxed-ref, closure-boxed-set):
New ops. The idea is to migrate Guile over to using flat dispay
closures. See the paper "Three Implementation Models for Scheme" by
Kent Dybvig for more details; this is the "stack-based" model.
* libguile/vm-engine.c:
* libguile/vm-engine.h: Add the necessary infrastructure to keep track
of a "closure" variable, like our "externals" in semantics, but
minimal, flat, and O(1) in implementation.
Andy Wingo [Sun, 19 Jul 2009 17:02:30 +0000 (19:02 +0200)]
renumber vm ops (objcode cookie bumped)
* libguile/objcodes.c (OBJCODE_COOKIE): Bump.
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Renumber instructions, so I can have a bit
more space to work.
Ludovic Courtès [Wed, 15 Jul 2009 21:57:18 +0000 (23:57 +0200)]
Bump version number for 1.9.1.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
Ludovic Courtès [Wed, 15 Jul 2009 21:56:27 +0000 (23:56 +0200)]
Make the non-integrated VM test-suite less verbose.
* testsuite/run-vm-tests.scm (run-vm-tests): Don't display the number of
tests passed since it's always 1 or 0.
Ludovic Courtès [Wed, 15 Jul 2009 21:53:22 +0000 (23:53 +0200)]
Add FIXMEs about misaligned objcode-metas.
* libguile/objcodes.c (scm_c_make_objcode_slice): Add comment about
misaligned `objcode-meta'.
* module/language/assembly/compile-bytecode.scm (write-bytecode):
Likewise.
Ludovic Courtès [Wed, 15 Jul 2009 21:51:42 +0000 (23:51 +0200)]
Fix unaligned access in the VM code.
* libguile/vm.c (struct t_32bit_aligned): New.
(really_make_boot_program)[bytes]: Use it. This fixes possibly
unaligned accesses, which cause a "bus error" on some platforms (e.g.,
sparc-*).
Ludovic Courtès [Wed, 15 Jul 2009 21:12:43 +0000 (23:12 +0200)]
Const-qualify buffers passed to `scm_c_make_objcode_slice ()'.
* libguile/objcodes.c (scm_c_make_objcode_slice): Add `const' qualifier
for PTR and DATA.
* libguile/objcodes.h: Update accordingly.
Ludovic Courtès [Wed, 15 Jul 2009 20:46:54 +0000 (22:46 +0200)]
Switch remaining GPLv2+ Guile-VM headers to LGPLv3+.
* module/system/base/compile.scm, module/system/base/syntax.scm,
module/system/repl/common.scm, module/system/repl/describe.scm,
module/system/vm/instruction.scm, module/system/vm/objcode.scm,
module/system/vm/profile.scm, module/system/vm/program.scm,
module/system/vm/trace.scm: Switch header from GPLv2+ to LGPLv3+.
Ludovic Courtès [Tue, 14 Jul 2009 23:17:32 +0000 (01:17 +0200)]
Fix typo in the compile-type verification of `OBJCODE_COOKIE'.
* libguile/objcodes.c: Fix `sizeof (OBJCODE_COOKIE)' assertion: the
trailing 0 must not be taken into account, and multiple of 8 means the
3 LSBs are clear.
Ludovic Courtès [Tue, 14 Jul 2009 23:03:35 +0000 (01:03 +0200)]
Make sure at compile-time that `OBJCODE_COOKIE' has the right size.
* libguile/objcodes.c: Use `verify' to assert that the size of
`OBJCODE_COOKIE' is a multiple of 8.
Ludovic Courtès [Tue, 14 Jul 2009 22:58:01 +0000 (00:58 +0200)]
Explicitly use Gnulib's `verify' module.
* m4/gnulib-cache.m4: Add `verify'.
Ludovic Courtès [Tue, 14 Jul 2009 22:55:33 +0000 (00:55 +0200)]
Augment `OBJCODE_COOKIE' to detect wrong endianness or word size.
* libguile/objcodes.c (OBJCODE_ENDIANNESS, _OBJCODE_STRINGIFY,
OBJCODE_STRINGIFY, OBJCODE_WORD_SIZE): New macros.
(OBJCODE_COOKIE): Use them. The intent is that `.go' files compiled
for a different endianness or word size are detected.
Ludovic Courtès [Tue, 14 Jul 2009 22:32:05 +0000 (00:32 +0200)]
Remove the `long_long' and `ulong_long' types.
* libguile/gen-scmconfig.c (main): Don't emit typedefs for `long_long'
and `ulong_long'. This was already deprecated in 1.8 and known to
cause conflicts with other libraries such as HDF5, as reported by Mark
Patterson <mpatterson@physics.queensu.ca>
(http://lists.gnu.org/archive/html/bug-guile/2009-02/msg00003.html).
Andy Wingo [Tue, 14 Jul 2009 20:55:35 +0000 (22:55 +0200)]
update NEWS
* NEWS: Update.
Andy Wingo [Thu, 2 Jul 2009 15:46:23 +0000 (17:46 +0200)]
NEWS has info on 1.9.N to 1.9.N+1 in addition to 1.8 to 2.0
* NEWS: Update to have an incremental section in addition to a
comprehensive 1.8->2.0 section.
Andy Wingo [Thu, 2 Jul 2009 15:46:23 +0000 (17:46 +0200)]
fix race in which some instruction name symbols could go unmarked
* libguile/instructions.c: In loops, replace scm_op_last with
SCM_VM_NUM_INSTRUCTIONS.
(fetch_instruction_table): Protect the instruction symbols from
collection. Before they were only marked by the name->opcode hash
table, leading to races in which they could be collected.
(scm_lookup_instruction_by_name): Protect the hash table earlier, as
it's not actually a stack variable, since it's static.
Andy Wingo [Thu, 2 Jul 2009 15:43:07 +0000 (17:43 +0200)]
fix bounds checks for the last element of bv-*-{ref,set}
* libguile/vm-i-scheme.c (BV_FIXABLE_INT_REF, BV_INT_REF):
(BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Fix the
bounds check for the last element.
Ludovic Courtès [Tue, 14 Jul 2009 15:12:04 +0000 (17:12 +0200)]
Remove potential "uninitialized variable" GCC warnings.
* libguile/vm-i-scheme.c (vector_ref, vector_set, BV_FIXABLE_INT_REF,
BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET,
BV_FLOAT_SET): Explicitly initialize all locals, to make some versions
of GCC happier. Patch by Dale P. Smith <dsmich@roadrunner.com>.
Ludovic Courtès [Tue, 14 Jul 2009 14:07:13 +0000 (16:07 +0200)]
Fix tests that assumed little endian.
* test-suite/tests/asm-to-bytecode.test (u32->u8-list): New procedure.
("compiler")[(load-program 3 2 1 0 () 3 #f (make-int8 3) (return)),
(load-program 3 2 1 0 () 3 (load-program 3 2 1 0 ...))]: Make these
tests work on hosts whose endianness is not little endian.
Ludovic Courtès [Sun, 5 Jul 2009 21:57:37 +0000 (23:57 +0200)]
Use Gnulib's `vsnprintf' module.
* m4/gnulib-cache.m4: Use `vsnprintf', needed by `deprecation.c'.