summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-25New annotated-tree-il Modulewip-compilerNoah Lavine2-215/+244
* module/analyzer/annotated-tree-il.scm: new module to hold functions that process annotated-tree-il but aren't central to the analyzer, like the conversion from tree-il. * module/analyzer/analyze.scm: remove code that goes in the new module.
2011-12-25Indentation FixesNoah Lavine1-68/+68
* test-suite/tests/analyzer.test: fix indentation of pass-if statements
2011-12-18Separate Environment CodeNoah Lavine3-48/+70
* module/analyzer/lexical-envs.scm: new file to hold the code for manipulating lexical environments * test-suite/tests/analyzer.test: test the lexical environment code * module/analyzer/analyze.scm: remove old lexical environment code
2011-12-17Analyze let and lexical-refNoah Lavine2-3/+31
* module/analyzer/analyze.scm: let and lexical-ref are now handled well enough that verifies work both inside and outside a let form. * test-suite/tests/analyzer.test: check that lets and lexical-refs are checked.
2011-12-17More verify TestsNoah Lavine1-0/+6
* test-suite/tests/analyzer.test: test that verify works correctly with multiple expressions.
2011-12-17Add verifyNoah Lavine2-9/+44
* module/analyzer/analyze.scm: recognize the 'verify' function as special, and add infrastructure for making sure that all verifies pass. * test-suite/tests/analyzer.test: add the most basic tests for verify.
2011-12-14Add verify NodesNoah Lavine1-1/+10
* module/analyzer/analyze.scm: add <a-verify> option to annotated-tree-il, and have tree-il->annotated-tree-il! generate it.
2011-12-14Prepare for AnalyzingNoah Lavine1-6/+16
* module/analyzer/analyze.scm: the first-draft of a real analyzer.
2011-12-14More value-set TestsNoah Lavine2-6/+66
* test-suite/tests/analyzer.test: test vs-car, vs-cdr and vs-cons * module/analyzer/value-sets.scm: bug fixes
2011-12-14Value Set UnionsNoah Lavine2-18/+95
* module/analyzer/value-sets.scm: add the basic union operation, and its two special cases add-value! and add-property! * test-suite/tests/analyzer.test: add tests for the value set union operations.
2011-12-13Test value-setsNoah Lavine1-1/+24
* test-suite/tests/analyzer.test: add tests for (analyzer value-sets)
2011-12-12Better set-queuesNoah Lavine1-15/+18
* module/analyzer/set-queue.scm: use a non-embarrassing set-queue implementation
2011-12-12Initial Analyzer WorkNoah Lavine4-0/+505
* module/analyzer: create folder * module/analyzer/value-sets.scm: a data structure for possible values * module/analyzer/set-queue.scm: a new type of queue * module/analyzer/analyze.scm: the analyzer itself
2011-11-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-1/+3
2011-11-11update letrec compilation testAndy Wingo1-1/+3
* test-suite/tests/tree-il.test ("letrec"): Update to clear the temporary `let' bindings.
2011-11-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo4-15/+62
2011-11-10fix bit-set*! bug (!)Andy Wingo2-7/+22
* libguile/bitvectors.c (scm_bit_set_star_x): Fix a long-standing (since 2005) bug in which instead of using the kv bitvector, we actually use the `v' bitvector. Also, change to allow `kv' being shorter than `v'. * test-suite/tests/bitvectors.test ("bit-set*!"): Add tests.
2011-11-09when leaving a non-tail let, allow bound vals to be collectedAndy Wingo2-9/+41
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Clear lexical stack slots at the end of a non-tail let, letrec, or fix. Fixes http://debbugs.gnu.org/9900. * test-suite/tests/gc.test ("gc"): Add test.
2011-11-09disable port lockingAndy Wingo1-3/+3
* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port) (scm_c_unlock_port): Disable port locking until I have time to sort out the bugs that are coming up.
2011-11-09inline dynwind guards for normal control flowAndy Wingo8-92/+115
* module/language/tree-il.scm (<tree-il>): Add `pre' and `post' fields to <dynwind>, so that we can inline the guard bodies in the normal control-flow case. It also avoids duplicating code in compile-glil, which probably hides more bugs in 2.0. (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold) (make-tree-il-folder, post-order!, pre-order!): Update. * module/language/tree-il/analyze.scm (analyze-lexicals): Update. * module/language/tree-il/compile-glil.scm (flatten-lambda-case): Update to use `pre' and `post' instead of compiling code twice. * module/language/tree-il/debug.scm (verify-tree-il): Update. * module/language/tree-il/peval.scm (peval): Update. Instead of doing complicated things in <dynwind>, handle 'dynamic-wind primcalls. * module/language/tree-il/primitives.scm (*primitive-expand-table*): Remove 'dynamic-wind mess. Adapt '@dynamic-wind. * test-suite/tests/tree-il.test ("partial evaluation"): Update tests.
2011-11-09Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo6-21/+108
Conflicts: module/language/tree-il/peval.scm module/language/tree-il/primitives.scm test-suite/tests/tree-il.test
2011-11-09simplify primitives.scm for dynwindAndy Wingo1-30/+13
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Remove a dynwind hack, as we have a good inliner now.
2011-11-09peval: fix dynwind bug.Andy Wingo2-2/+53
* module/language/tree-il/peval.scm (peval): The <dynwind> compiler will copy the winder and unwinder values, so make sure that they are constant, and if not, create lexical bindings. Fixes http://debbugs.gnu.org/9844. * test-suite/tests/tree-il.test ("partial evaluation"): Add a couple <dynwind> tests.
2011-11-09fix <dynwind> serialization.Andy Wingo1-3/+3
* module/language/tree-il.scm (unparse-tree-il): Fix <dynwind> serialization.
2011-11-09peval: don't copy assigned lexical bindingsAndy Wingo1-11/+17
* module/language/tree-il/peval.scm (peval): Since constant-expression? is used to determine whether to copy values, return #f if any lexical is assigned.
2011-11-08lock ports in `write' and `display'Andy Wingo1-0/+8
* libguile/print.c (scm_write, scm_display): Lock the port during `display' and `write' calls. Fixes https://savannah.gnu.org/bugs/?33996.
2011-11-08add scm_dynwind_lock_portAndy Wingo2-0/+27
* libguile/ports.h: * libguile/ports.c (scm_dynwind_lock_port): New function.
2011-11-08locking for write, lfwriteAndy Wingo6-27/+46
* libguile/ports.c (scm_c_write_unlocked, scm_c_write) (scm_lfwrite_unlocked, scm_lfwrite): Add locking and _unlocked variants. Change uses to _unlocked.
2011-11-08locking for putc, putsAndy Wingo44-215/+233
* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions.
2011-11-08locking on port buffering operationsAndy Wingo10-24/+57
* libguile/ports.c (scm_fill_input_unlocked, scm_fill_input) (scm_end_input, scm_end_input_unlocked, scm_flush) (scm_flush_unlocked): Add locking and _unlocked variants. * libguile/filesys.c: * libguile/fports.c: * libguile/gdbint.c: * libguile/r6rs-ports.c: * libguile/read.c: * libguile/rw.c: Adapt callers to use _unlocked variants.
2011-11-08locking on unget_byte, ungetc, ungetsAndy Wingo6-38/+63
* libguile/ports.h: * libguile/ports.c (scm_unget_byte_unlocked, scm_unget_byte) (scm_ungetc_unlocked, scm_ungetc, scm_ungets_unlocked, scm_ungets): Add locking and _unlocked variants. * libguile/arrays.c: * libguile/rdelim.c: * libguile/read.c: * libguile/vports.c: Adapt callers to use the _unlocked variants.
2011-11-08locking on scm_c_read, scm_getcAndy Wingo6-39/+65
* libguile/ports.c (scm_c_read_unlocked, scm_c_read, scm_getc_unlocked) (scm_getc): Split getc and read operations into locked and unlocked variants. Change most uses to use the _unlocked version.
2011-11-08threadsafe get-byte-or-eof, peek-byte-or-eofAndy Wingo3-19/+45
* libguile/ports.h (scm_get_byte_or_eof_unlocked): (scm_peek_byte_or_eof_unlocked): Rename, adding _unlocked. * libguile/ports.c (scm_get_byte_or_eof, scm_peek_byte_or_eof): Add locking implementations. Adapt callers to use _unlocked variants; they will do locking. * libguile/read.c (read_token, scm_read_semicolon_comment) (scm_read_shebang): Use unlocked variants. We will add locking later.
2011-11-08threadsafe port revealed countsAndy Wingo2-2/+31
* libguile/ports.h: * libguile/ports.c (scm_revealed_count, scm_set_port_revealed_x): Make threadsafe. (scm_adjust_port_revealed_x): New function, to adjust a port's revealed count in a threadsafe way.
2011-11-08scm_c_lock_port takes a portAndy Wingo1-9/+9
* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port) (scm_c_unlock_port): Take a port instead of an entry.
2011-11-07ports implementation reorderingAndy Wingo2-921/+953
* libguile/ports.h: Slight reorder. * libguile/ports.c: Reorder ports implementation to match the header file. This will make it easier to add locking and _unlocked variants.
2011-11-07threadsafe access to scm_ptobsAndy Wingo6-100/+140
* libguile/ports.h (SCM_PORT_DESCRIPTOR): New macro, to get at a port descriptor in the third word of a port instead of looking it up in a table. (scm_c_port_type_ref, scm_c_port_type_add_x): New API for working with numbered ptob descriptors. (SCM_PTOBNAME): Implement in terms of scm_c_port_type_ref. (scm_get_byte_or_eof, scm_peek_byte_or_eof): Use SCM_PORT_DESCRIPTOR. * libguile/ports.c (scm_c_num_port_types, scm_c_port_type_ref) (scm_c_port_type_add_x, scm_make_port_type): Protect scm_ptobs access with a mutex. Have it be an array of pointers instead of an array of structures. Adapt users to the new APIs. (scm_c_make_port_with_encoding): Allocate ports with three words. The third word is the ptob descriptor. * libguile/backtrace.c: * libguile/goops.c: * libguile/ioext.c: * libguile/print.c: Adapt to use scm_c_port_type_ref and SCM_PORT_DESCRIPTOR.
2011-11-07reorder ports.h declarationsAndy Wingo1-44/+74
* libguile/ports.h: Reorder declarations.
2011-11-07remove scm_markstreamAndy Wingo2-16/+3
* libguile/ports.h: * libguile/ports.c (scm_markstream): Remove obsolete definition. Moved around a couple of other declarations.
2011-11-07ports.h: remove unimplemented declarationsAndy Wingo1-9/+1
* libguile/ports.h (scm_grow_port_cbuf, scm_pt_size, scm_pt_member): Remove declarations of unimplemented functions. Move a couple of other definitions around.
2011-11-07inlined port functions to ports.hAndy Wingo2-107/+106
* libguile/inline.h: * libguile/ports.h (scm_get_byte_or_eof, scm_peek_byte_or_eof) (scm_putc, scm_puts): Move definitions here, from inline.h.
2011-11-07add lock to scm_t_portAndy Wingo3-0/+45
* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port) (scm_c_unlock_port): New inline functions. (scm_t_port): Add a lock field, if threads are enabled. This is a first step towards threadsafe ports. * libguile/ports.c (scm_c_make_port_with_encoding): Init the port's lock. * libguile/inline.c: Residualize the inline functions from ports.h.
2011-11-07regenerate psyntax-ppAndy Wingo1-9274/+10781
* module/ice-9/psyntax-pp.scm: Regenerate.
2011-11-07add tests for hygienic name introductionAndy Wingo1-1/+37
* test-suite/tests/syntax.test ("top-level define"): Add tests for hygienic introduction of names.
2011-11-07hygienically rename macro-introduced bindings, reproduciblyAndy Wingo1-2/+20
* module/ice-9/psyntax.scm (chi-top-sequence): Detect bindings to identifiers introduced by macros. In that case, in order to preserve hygiene, uniquify the variable's name, but in a way that is reproduceable (i.e., yields the same uniquified name after a recompile).
2011-11-07fix scope bug in <module> definition in boot-9Andy Wingo1-1/+1
* module/ice-9/boot-9.scm (define-record-type): Fix scope bug when generating identifiers.
2011-11-07another scoping testAndy Wingo1-0/+13
* test-suite/tests/syntax.test ("top-level define"): Add another test for scoping.
2011-11-07resolve-identifier for toplevel definitions resolves by moduleAndy Wingo1-33/+63
* module/ice-9/psyntax.scm (id-var-name): For mapping identifiers to toplevel definitions, also compare against the module. (resolve-identifier): Pass the module to id-var-name when looking up identifiers. (free-id=?): Adapt to id-var-name change. (chi-top-sequence): When adding a mapping from the given identifier to a toplevel definition, make the name be a pair.
2011-11-07add scoping testAndy Wingo1-1/+18
* test-suite/tests/syntax.test ("top-level define"): Add a test for module scoping of introduced identifiers.
2011-11-07defined identifiers scoped in the current moduleAndy Wingo1-2/+3
* ice-9/psyntax.scm (chi-top-sequence): Wrap defined identifiers with the current module. Fixes http://savannah.gnu.org/bugs/?31472.