summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-05-21Test signed narrow arguments in FFI better.wip-raeburn-miscKen Raeburn2-2/+16
* test-suite/standalone/test-ffi-lib.c (test_ffi_s16_s8): New function. * test-suite/standalone/test-ffi: Test it. Also test test_ffi_sum with both positive and negative values for the narrower-than-64-bit arguments.
2012-05-21Eliminate uses of GC_PTR, a holdover from libgc 6.x.Ken Raeburn11-38/+34
* libguile/bdw-gc.h (GC_PTR): Don't define. * libguile/finalizers.c (scm_i_set_finalizer): Use void* instead of GC_PTR. * libguile/foreign.c (pointer_finalizer_trampoline): Likewise. * libguile/guardians.c (finalize_guarded, scm_i_guard): Likewise. * libguile/numbers.c (finalize_bignum): Likewise. * libguile/ports.c (finalize_port, finalize_iconv_descriptors): Likewise. * libguile/smob.c (finalize_smob): Likewise. * libguile/struct.c (struct_finalizer_trampoline): Likewise. * libguile/weak-set.c (move_weak_entry, resize_set): (weak_set_add_x, weak_set_remove_x): Likewise, but also change some casts that should've been GC_PTR* to void**, and don't cast pointer values to void*. * libguile/weak-table.c (register_disappearing_links): (unregister_disappearing_links, move_disappearing_links): Likewise. * libguile/weak-vector.c (scm_c_weak_vector_set_x): Likewise.
2012-05-21Don't use addresses of labels with LLVM.Ken Raeburn2-0/+24
* libguile/vm-engine.h: If __llvm__ is defined, undef HAVE_LABELS_AS_VALUES. * libguile/vm-expand.h: Likewise.
2012-05-21Always use VM_LABEL.Ken Raeburn1-1/+1
* libguile/vm-expand.h (VM_TAG) [!HAVE_LABELS_AS_VALUES]: Generate the label as well as the case label, since vm-i-scheme.c uses the labels unconditionally.
2012-05-21Report time taken for 'guild compile' commands.Ken Raeburn2-3/+3
* am/guilec (.scm.go, .el.go): Report the time taken for each "guild compile" command. * module/Makefile.am (ice-9/psyntax-pp.go): Likewise.
2012-05-21Require BDW-GC version 7.2 or better.Ken Raeburn1-3/+3
* libguile/bdw-gc.h: Error out if the GC version is less than 7.2. Drop support for including <gc/gc_local_alloc.h> for version 6.x.
2012-05-21Fix FFI struct sizing to account for trailing padding.Ken Raeburn2-1/+6
* libguile/foreign.c (scm_sizeof): Make sure the overall size is a multiple of the alignment of the structure. * test-suite/tests/foreign.test: Test size of { double, int8 }.
2012-05-20Fix lock handling bug in commit aac980de43a0466b968a56607664f5ebbca6b751.Ken Raeburn2-2/+2
* libguile/weak-set.c (resize_set): When releasing a lock temporarily to do an allocation, re-lock it afterwards, instead of unlocking again. * libguile/weak-table.c (resize_table): Likewise.
2012-05-17inline scm_cons, scm_car, scm_cdrAndy Wingo4-55/+68
* libguile/pairs.h (scm_cons, scm_car, scm_cdr): Define these as inline functions. (scm_is_pair): Move here from inline.h. * libguile/pairs.c: Remove definitions here, and define gsubrs. * libguile/inline.h: Remove scm_is_pair implementation. * libguile/inline.c: Include pairs.h to residualize inlines from pairs.h.
2012-05-17add guile-2.2 featureAndy Wingo1-0/+1
* module/ice-9/boot-9.scm (%cond-expand-features): Add guile-2.2 feature.
2012-05-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo4-7/+20
2012-05-11fix more assumptions that the frame-procedure is a procedureAndy Wingo4-8/+21
* libguile/frames.c (scm_frame_source, scm_frame_previous): * libguile/stacks.c (scm_make_stack): * module/ice-9/boot-9.scm (exception-printers): * module/system/vm/frame.scm (frame-call-representation): Fix more assumptions that frame-procedure is a program, or even a procedure.
2012-05-10Merge remote-tracking branch 'origin/stable-2.0' into stable-2.0Andy Wingo4-15/+57
2012-05-10Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo5-199/+141
Conflicts: libguile/vm-engine.c libguile/vm-i-system.c libguile/vm.c
2012-05-10refactor vm application of non-programs; boot continuation refactorAndy Wingo5-199/+141
* libguile/frames.c (scm_frame_instruction_pointer): * module/system/vm/frame.scm (frame-bindings): (frame-next-source, frame-call-representation): Fix a few locations that thought that the frame-procedure will always be a VM procedure. This will not not be the case when traversing the stack of an application of a non-procedure. * libguile/vm-i-system.c (call, tail-call, mv-call): Instead of special-casing structs and smobs at these call sites, just set up the stack, and jump to a generic apply loop if the proc is not a program. * libguile/vm-engine.c: The generic apply loop is here. Also, the boot program is now simply a boot continuation, and can handle any number of arguments. * libguile/vm.c (make_boot_program): Update the code that makes the boot continuation.
2012-05-08Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo12-116/+225
Conflicts: libguile/ports.c libguile/ports.h libguile/read.c libguile/vm-i-system.c
2012-05-08Add missing `SCM_API' for `scm_take_from_input_buffers'.Ludovic Courtès1-1/+2
* libguile/ports.h (scm_take_from_input_buffers): Add `SCM_API'.
2012-05-08Fix `setvbuf' to leave the line/column number unchanged.Ludovic Courtès3-14/+55
* libguile/fports.c (scm_setvbuf): Use `scm_take_from_input_buffers' directly instead of `scm_drain_input'; use `scm_unget_byte' instead of `scm_unread_string' to put the drained input back to PORT. This leaves PORT's line/column numbers unchanged, whereas they'd previously be decreased by the `scm_unread_string' call. * libguile/ports.c (scm_take_from_input_buffers): Update description and variable names to refer to "bytes", not "chars". * test-suite/tests/ports.test ("setvbuf"): New test prefix.
2012-05-08docbook->texi fixAndy Wingo1-2/+6
* module/texinfo/docbook.scm (*sdocbook->stexi-rules*): Only convert ulink to uref if there is a URL attribute.
2012-05-07(texinfo docbook) support for @acronymAndy Wingo1-1/+3
* module/texinfo/docbook.scm (*sdocbook->stexi-rules*): Recognize "acronym" as parsing to the @acronym texinfo command.
2012-05-07add support for texinfo parsed arguments, like @acronymAndy Wingo3-12/+87
* module/texinfo.scm (texi-command-specs): Add a new kind of texinfo command, inline-text-args, a sort of a cross between inline-args, which are unparsed, and inline-text, which is. Perhaps this should supersede inline-args at some point. In any case, add acronym as an inline-text-args element. (inline-content?, arguments->attlist, complete-start-command) (parse-inline-text-args, make-dom-parser): Adapt for inline-text-args. * module/texinfo/serialize.scm (inline-text-args): Add serialization for @acronym. * test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add some tests.
2012-05-07Add a missing SYNC_ALL in variable-refAndy Wingo1-0/+1
* libguile/vm-i-system.c (variable-ref): Add a missing SYNC_ALL.
2012-05-07Optimize `scm_read_string'.Ludovic Courtès2-19/+38
According to the new benchmarks, this leads a 5% speed improvement when reading small strings, and a 27% improvement when reading large strings. * libguile/read.c (READER_STRING_BUFFER_SIZE): Change to 128; update comment to mention codepoints. (scm_read_string): Make `str' a list of strings, instead of a string. Store characters read in buffer `c_str'. Cons to STR when C_STR is full, and concatenate/reverse at the end. * benchmark-suite/benchmarks/read.bm (small, large): New variables. Set %DEFAULT-PORT-ENCODING to "UTF-8". ("read")["small strings", "large strings"]: New benchmarks.
2012-05-06Make `scm_unget_byte' public.Ludovic Courtès1-2/+2
* libguile/ports.h (scm_unget_byte): Make `SCM_API' instead of `SCM_INTERNAL'.
2012-05-06read: Avoid `void *' pointer arithmetic.Ludovic Courtès1-1/+1
* libguile/read.c (read_complete_token): Make `new_buf' a `char *' to avoid pointer arithmetic on `void *'.
2012-05-06Build with `-Wpointer-arith' when available.Ludovic Courtès1-3/+1
* configure.ac (POTENTIAL_GCC_CFLAGS): Add `-Wpointer-arith'.
2012-05-05Correct typing of assertion in the `wind' instruction.Ludovic Courtès1-2/+4
* libguile/vm-i-system.c (wind): Check `scm_to_bool (scm_thunk_p (x))' instead of `scm_thunk_p'.
2012-05-04Simplify the reader's `read_complete_token'.Ludovic Courtès1-65/+35
* libguile/read.c (read_token): Remove unneeded `const' before `size_t'. (read_complete_token): Remove `overflow_buffer' parameter; return `char *' instead of `int'. Allocate the overflow buffer with `scm_gc_malloc_pointerless' instead of `scm_malloc'. Return either the overflow buffer or BUFFER. (scm_read_number, scm_read_mixed_case_symbol, scm_read_number_and_radix): Rename `buffer' to `local_buffer', and `overflow_buffer' to `buffer'. Remove `overflow'. Adjust code to new `read_complete_token'.
2012-04-30Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo9-308/+345
Conflicts: libguile/vm-engine.c libguile/vm-i-system.c
2012-04-30push error handlers out of line in the vmAndy Wingo6-319/+331
* libguile/vm.c: (vm_error): (vm_error_bad_instruction): (vm_error_unbound): (vm_error_unbound_fluid): (vm_error_not_a_variable): (vm_error_not_a_thunk): (vm_error_apply_to_non_list): (vm_error_kwargs_length_not_even): (vm_error_kwargs_invalid_keyword): (vm_error_kwargs_unrecognized_keyword): (vm_error_too_many_args): (vm_error_wrong_num_args): (vm_error_wrong_type_apply): (vm_error_stack_overflow): (vm_error_stack_underflow): (vm_error_improper_list): (vm_error_not_a_pair): (vm_error_not_a_bytevector): (vm_error_not_a_struct): (vm_error_no_values): (vm_error_not_enough_values): (vm_error_continuation_not_rewindable): (vm_error_bad_wide_string_length): (vm_error_invalid_address): (vm_error_object): (vm_error_free_variable): New internal helpers, implementing VM error handling. * libguile/vm-engine.h (VM_ASSERT): New helper macro. (ASSERT, CHECK_OBJECT, CHECK_FREE_VARIABLE): (PRE_CHECK_UNDERFLOW, PUSH_LIST): Use the new helper. * libguile/vm-i-loader.c: * libguile/vm-i-scheme.c: * libguile/vm-i-system.c: Use VM_ASSERT and the out-of-line error handlers. * libguile/vm-engine.c (vm_engine): Remove inline error handlers, and remove a couple of local vars. Use VM_ASSERT. Have halt handle the return itself.
2012-04-30add internal SCM_NOINLINE definitionAndy Wingo1-0/+5
* libguile/_scm.h (SCM_NOINLINE): New internal define, for things that we definitely don't want the compiler to inline.
2012-04-30add scm_c_values helperAndy Wingo2-5/+18
* libguile/values.h: * libguile/values.c (scm_c_values): New public helper.
2012-04-30fix peval test for recent mergeAndy Wingo1-2/+2
* test-suite/tests/peval.test: Fix test for master.
2012-04-26Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo9-222/+328
Conflicts: test-suite/tests/cse.test
2012-04-26Merge commit 'f66cbb99ee096186837536885d3436bb334df34d'Andy Wingo4-0/+853
2012-04-26Merge commit '1cd63115be7a25d0ea18aaa0e1eff5658d8db77a'Andy Wingo4-60/+361
Conflicts: module/language/tree-il/peval.scm test-suite/tests/peval.test
2012-04-26Merge commit 'de1eb420a5a95b17e85b19c4d98c869036e9ecb0'Andy Wingo7-1288/+1277
Conflicts: module/language/tree-il/primitives.scm test-suite/tests/tree-il.test
2012-04-26Merge commit 'd10f7b572c0ca1ccef87f9c46069daa30946e0cf'Andy Wingo28-196/+272
Conflicts: libguile/smob.c libguile/smob.h test-suite/tests/tree-il.test
2012-04-23Clean up stack testsNoah Lavine1-46/+23
* test-suite/tests/eval.test: remove duplicate code.
2012-04-23make-stack handles prompt tags betterNoah Lavine2-33/+70
* libguile/stacks.c: update make-stack and narrow_stack to handle prompt tags that are not symbols. * test-suite/tests/eval.test: add tests for trimming a stack with a prompt tag.
2012-04-23vlist performance improvements; allocate vhash data inlineAndy Wingo1-142/+159
* module/ice-9/vlist.scm (make-block): If we are making a hash table, allocate it inline with the contents. Otherwise don't even add a pointer to the block. (block-hash-table?): New internal accessor. (block-ref*): Remove. Vhash entries are no longer wrapped. (block-ref): (block-hash-table-next-offset): (block-hash-table-set-next-offset!): (block-hash-table-ref): (block-hash-table-set!): (block-hash-table-add!): Adapt to take content vector explicitly, and to expect the hash table inline with the contents. Some of these accessors are new. Adapt callers. (assert-vlist): New helper. (vlist-cons): Update comment. (vhash?): Update scheme to allocate the hash table and chain links inline with the contents. (%vhash-fold*, %vhash-assoc): Rewrite to be more performant.
2012-04-23avoid emitting degenerate aliases in pevalAndy Wingo2-11/+71
* module/language/tree-il/peval.scm (<operand>, make-operand) (make-bound-operands, peval): Avoid emitting needless aliases in degenerate cases of let. (visit-operand): If we visit an operand with a fresh counter and have to abort, record that fact. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
2012-04-23vlist-cons micro-optimizationsAndy Wingo1-24/+31
* module/ice-9/vlist.scm (set-block-next-free!): Define this instead of increment-block-next-free!. (block-append!): Refactor to take an offset, and only append if the offset is the next free value, and there is space in the block. (block-cons): Refactor to not be a loop. The partial evaluator would have to understand effects analysis in order to be able to unroll it, and there's at most one recursion. Recovers the performance loss resulting from the previous commit.
2012-04-23slight vlist refactorAndy Wingo1-18/+11
* module/ice-9/vlist.scm: Use define-inlinable instead of define-inline, to ensure strict argument evaluation. There is a slight performance penalty, but I hope subsequent hacks make it up.
2012-04-23new pass: cseAndy Wingo4-0/+854
* module/language/tree-il/cse.scm: New pass, some simple common subexpression elimination with effects analysis. * test-suite/tests/cse.test: New test. * test-suite/Makefile.am: * module/Makefile.am: Adapt.
2012-04-23minor tweaks to a peval testAndy Wingo1-4/+4
* test-suite/tests/peval.test: Update mutable var test to really ensure that the function can't inline.
2012-04-23fix replacement of CSE with lexical-refAndy Wingo2-12/+24
* module/language/tree-il/cse.scm (cse): Fix dominator unrolling for lexical propagation. * test-suite/tests/cse.test ("cse"): Add test.
2012-04-23peval uses effects analysisAndy Wingo1-53/+25
* module/language/tree-il/peval.scm: Use effects analysis from (language tree-il effects) instead of our own constant-expression?. Eagerly mark assigned lexicals as non-copyable.
2012-04-23cse hashing tweakAndy Wingo1-1/+1
* module/language/tree-il/cse.scm (cse): Minor tweak to hash depth based on time profile of compiling peval.scm.
2012-04-23more inlining in effects.scmAndy Wingo1-11/+12
* module/language/tree-il/effects.scm (define-effects) (&no-effects, &all-effects-but-bailout): (cause, &depends-on, &causes, depends-on-effects?) (causes-effects?, effects-commute?): Add ham-fisted inlining.