summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* add new rtl vmwip-rtl-vmAndy Wingo2013-05-2319-27/+3624
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/vm-engine.c (rtl_vm_engine): Add new VM. (vm_engine): Add support for calling RTL programs. * libguile/tags.h (scm_tc7_rtl_program): New type for procedures that run on the new VM. * libguile/evalext.c (scm_self_evaluating_p): * libguile/goops.c (scm_class_of): * libguile/print.c (iprin1): * libguile/procprop.c (scm_i_procedure_arity): * libguile/procs.c (scm_procedure_p): Add hooks for the new tc7. * libguile/programs.h: * libguile/programs.c (scm_make_rtl_program, scm_i_rtl_program_print) (scm_rtl_program_p, scm_rtl_program_code): * module/system/vm/program.scm: Add constructors and accessors for the new "RTL programs". * libguile/vm.c (rtl_boot_continuation): Define a boot program. (rtl_apply, rtl_values): New static RTL programs. * libguile/frames.c (scm_frame_num_locals): Adapt for frames of RTL programs. * libguile/frames.h: Add description of RTL frames. * libguile/Makefile.am: Add rules to generate vm-operations.h. * .gitignore: Ignore vm-operations.h. * module/system/vm/instruction.scm: * libguile/instructions.c: * libguile/instructions.h: Use vm-operations.h to define enumerated values for the new RTL opcodes. Define some helper macros to pack and unpack 32-bit instruction words. (rtl-instruction-list): New function, exported by (system vm instruction). * libguile/objcodes.c: Wire up the bits needed to detect the new RTL bytecode and load it, as appropriate.
* refactor to resolve_variableAndy Wingo2013-05-231-16/+13
| | | | * libguile/vm.c (resolve_variable): Slight refactor.
* cpp hygiene in the vmAndy Wingo2013-05-233-6/+47
| | | | | | | * libguile/vm-engine.c: * libguile/vm-i-scheme.c: * libguile/vm-i-system.c: CPP hygiene: the code that #defines, #undefs. Makes things cleaner given the multiple inclusion dance we do.
* pop-continuation abort-continuation hooks pass return vals directlyAndy Wingo2013-05-238-113/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/ref/api-debug.texi (VM Hooks): Update documentation. * libguile/vm.c (vm_dispatch_hook): * libguile/vm-engine.c: Rework the hook machinery so that they can receive an arbitrary number of arguments. The return and abort hooks will pass the values that they return to their continuations. (vm_engine): Adapt to ABORT_CONTINUATION_HOOK change. * libguile/vm-i-system.c (return, return/values): Adapt to POP_CONTINUATION_HOOK change. * module/system/vm/frame.scm (frame-return-values): Remove. The pop-continuation-hook will pass the values directly. * module/system/vm/trace.scm (print-return): (trace-calls-to-procedure): (trace-calls-in-procedure): Update to receive return values directly. * module/system/vm/traps.scm (trap-in-procedure) (trap-in-dynamic-extent): Ignore return values. (trap-frame-finish, trap-calls-in-dynamic-extent) (trap-calls-to-procedure): Pass return values to the handlers.
* Allow vm_engine caller to pass arguments on the stack.Andy Wingo2013-05-231-4/+13
| | | | | * libguile/vm-engine.c (vm_engine): Allow the caller to pass arguments on the stack.
* vm-engine: remove register assignmentsAndy Wingo2013-05-231-61/+12
| | | | | | | | | | * libguile/vm-engine.c: Remove the register assignments inherited from the 1990s. GCC does seem to allocate reasonably on systems with enough registers (e.g. x86-64), and on system with too few (x86-32) we disabled manual allocation. Anyway this code was never tested, so it's better to leave the compiler to do its own thing, until proven otherwise. Also in the RTL VM we don't need to allocate a register to the SP, because it isn't accessed as much.
* remove some configurability in vm-engineAndy Wingo2013-05-232-67/+3
| | | | | | | | | * libguile/vm-engine.c: Remove the ability for the VM to check object access, free variable access, and the ip. They were off by default. Since they will be different in the RTL VM, their presence is just making things confusing. * libguile/vm.c: Remove corresponding error helpers.
* minor vm-engine cleanupsAndy Wingo2013-05-231-25/+18
| | | | | * libguile/vm-engine.c: Some very minor cleanups: indenting, use of VM_ASSERT, commenting.
* remove CONS macro in VM; use scm_cons insteadAndy Wingo2013-05-233-42/+8
| | | | | | | | | | * libguile/vm-engine.c (CONS): Remove. Callers should use scm_cons instead, syncing registers beforehand. (POP_LIST): Adapt, only synchronizing once. (POP_LIST_MARK, POP_CONS_MARK): Remove unused macros. * libguile/vm-i-scheme.c (cons): * libguile/vm-i-system.c (push-rest, bind-rest): Adapt.
* inline vm-engine.h into vm-engine.cAndy Wingo2013-05-233-405/+377
| | | | | | | * libguile/vm-engine.h: * libguile/vm-engine.c: Fold vm-engine.h into vm-engine.c. * libguile/Makefile.am: Adapt.
* add (find-mapped-elf-image) procedure to (system vm objcode) moduleAndy Wingo2013-05-232-2/+111
| | | | | | | | * libguile/objcodes.c (register_elf, scm_find_mapped_elf_image): New interfaces that keep a list of all ELF mappings. Exported from the (system vm objcode) module. * module/system/vm/objcode.scm: Export find-mapped-elf-image.
* refactor and simplify ELF loader in objcodes.cAndy Wingo2013-05-231-240/+196
| | | | | | | | | | | | | | * libguile/objcodes.c (sniff_elf_alignment, alloc_aligned) (copy_and_align_elf_data): New helpers for portably re-aligning ELF data from read(2) or from a bytevector. (load_thunk_from_memory): Simplify! Now there is only one procedure that loads ELF, and it does less: it simply receives the whole image in one array, hopefully from mmap. (scm_load_thunk_from_file): Use new map_file_contents helper, and go through load_thunk_from_memory. (scm_load_thunk_from_memory): Pass load_thunk_from_memory a piece of memory that it owns, and that is appropriately aligned.
* add scm_{to,from}_{u,}intptr_tAndy Wingo2013-05-232-13/+31
| | | | | | | | * libguile/numbers.h (scm_to_intptr_t, scm_from_intptr_t) (scm_to_uintptr_t, scm_from_uintptr_t): New defines. * libguile/foreign.c: Remove definitions here; adapt callers to use new names with _t suffixes.
* refactor linker to lay out ELF files and memory in the same wayAndy Wingo2013-05-232-170/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * module/system/vm/linker.scm (make-linker-object): (linker-object-section-symbol): (linker-object-symbols*): Create a symbol to the start of a linker object. Hide it from the external linker-object-symbols* accessor. (segment-kind, count-segments): Sections without SHF_ALLOC don't get segments. (collate-objects-into-segments): Allow for #f segment types. If two sections have the same type and flags, leave them in the same order. (align): Allow for 0 alignment. (add-elf-objects): New helper: puts the ELF data structures (header, segment table, and section table) in sections of their own. This lends a nice clarity and conceptual unity to the linker. (relocate-section-header, allocate-segment): Lay out segments with congruent, contiguous addresses, so that we can just mmap the file and if debugging sections that are not in segments are present, they can be lazily paged in if needed by the kernel's VM system. (link-elf): Refactor to use the new interfaces. * test-suite/tests/linker.test: Update to expect the additional sections for the header and section table.
* elf: add accessors for header members that might need relocationAndy Wingo2013-05-231-2/+22
| | | | | | * module/system/vm/elf.scm (elf-header-shoff-offset) (elf-section-header-addr-offset, elf-section-header-offset-offset): New accessors.
* ELF refactor and consequent linker simplificationsAndy Wingo2013-05-234-245/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | * module/system/vm/elf.scm: Add commentary. (make-elf): Add a constructor similar to make-elf-segment and make-elf-section. (write-elf32-header, write-elf64-header, write-elf-header): Take an <elf> instead of all the fields separately. (<elf-segment>, <elf-section>): Add "index" property. Adapt constructors accordingly. * module/language/objcode/elf.scm (bytecode->elf): Arrange to set the section indexes when creating ELF sections. * module/system/vm/linker.scm (fold-values): New helper. (alloc-segment, relocate-section-header): Arrange to set segment and section indexes. (find-shstrndx): New helper, replaces compute-sections-by-name. Now that sections know their indexes, this is easier. (allocate-elf, write-elf): New helpers, factored out of link-elf. Easier now that sections have indexes. (link-elf): Simplify. Check that the incoming objects have sensible numbers. * test-suite/tests/linker.test: Update to set #:index on the linker objects.
* split linker out of elf moduleAndy Wingo2013-05-235-383/+562
| | | | | | | | | | | | | | | * module/Makefile.am: * module/system/vm/linker.scm: New file, split out of (system vm elf). (make-string-table, string-table-intern): Export under their bare names, instead of make-elf-string-table and elf-string-table-intern. * module/system/vm/elf.scm: Remove linking capabilities. (string-table-ref): Export. * module/language/objcode/elf.scm (bytecode->elf): Adapt to use (system vm linker). * test-suite/tests/linker.test: New test.
* Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver2013-04-1467-1105/+3076
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: GUILE-VERSION libguile/array-map.c libguile/fports.h libguile/gc.h libguile/inline.h libguile/ports.c libguile/ports.h libguile/print.c libguile/r6rs-ports.c libguile/read.c test-suite/tests/00-socket.test
| * Using 'pass-if-equal' in coding.test.Mark H Weaver2013-04-141-56/+56
| | | | | | | | | | * test-suite/tests/coding.test ("block comments", "line comments"): Use 'pass-if-equal'.
| * Adjust BOM tests to reflect the fact that big endian is used by default.Mark H Weaver2013-04-141-12/+2
| | | | | | | | | | | | | | | | * test-suite/tests/ports.test ("BOM not discarded unless at start of UTF-16 stream", "BOM not discarded unless at start of UTF-32 stream"): Adjust tests to reflect the fact that, in the absence of a BOM, big endian will be used by default for the "UTF-16" and "UTF-32" encodings.
| * Add 2012 and 2013 to copyright notice on numbers.test.Mark H Weaver2013-04-101-1/+2
| | | | | | | | | | * test-suite/tests/numbers.test: Add 2012 and 2013 to copyright notice. It was modified both of those years.
| * Do not add $(EXEEXT) to guild or guile-tools.Mark H Weaver2013-04-101-2/+2
| | | | | | | | | | * meta/Makefile.am (install-exec-hook): Do not add $(EXEEXT) to guild or guile-tools.
| * Mention `open-file' in NEWS.v2.0.9Ludovic Courtès2013-04-101-3/+3
| |
| * doc: Require libunistring 0.9.3 in `README'.Ludovic Courtès2013-04-101-1/+1
| | | | | | | | | | * README: Require libunistring 0.9.3. The <unitypes.h> header in 0.9.1 lacks the _UC_ATTRIBUTE_CONST definition, leading to build failures.
| * build: Tell `gen-scmconfig' whether the system has `struct timespec'.Ludovic Courtès2013-04-102-1/+24
| | | | | | | | | | | | | | | | * configure.ac: Reinstate `struct timespec' check removed in commit 7e7c6f6a937005b08fffd5aeccdf992459b07137, but define `HAVE_SYSTEM_STRUCT_TIMESPEC' instead of `HAVE_STRUCT_TIMESPEC'. * libguile/gen-scmconfig.c (main): Change `HAVE_STRUCT_TIMESPEC' to `HAVE_SYSTEM_STRUCT_TIMESPEC'.
| * Bump version number for 2.0.9.Ludovic Courtès2013-04-102-2/+5
| | | | | | | | * GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
| * doc: Update `release.org'.Ludovic Courtès2013-04-101-8/+7
| | | | | | | | | | * doc/release.org: Recommend "distcheck". Add `makeinfo' to the bootstrap tool list.
| * stime: Remove #ifdef HAVE_*_H for headers provided by Gnulib.Ludovic Courtès2013-04-101-10/+2
| | | | | | | | | | | | | | * libguile/stime.c: Remove #ifdef HAVE_SYS_TIMES_H, HAVE_SYS_TYPES_H, and HAVE_STRING_H since those headers are always provided by Gnulib when the corresponding macro is undefined. Fixes a regression on MinGW introduced by commit 40e2a31.
| * Make `build-aux/gendocs.sh' executable.Ludovic Courtès2013-04-101-0/+0
| |
| * Bump version number for 2.0.8.Ludovic Courtès2013-04-091-3/+3
| | | | | | | | | | | | | | * GUILE-VERSION (GUILE_MICRO_VERSION): Increment. (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C functions `scm_c_bind_keyword_arguments' et al. (LIBGUILE_INTERFACE_AGE): Increment.
| * tests: Skip FFI tests involving `scm_is_pair' when `dynamic-func' fails.Ludovic Courtès2013-04-091-4/+6
| | | | | | | | | | | | | | * test-suite/tests/foreign.test ("make-pointer")["equal? modulo finalizer", "equal? modulo finalizer (set-pointer-finalizer!)"]: Wrap `dynamic-func' in `false-if-exception' (static builds on NetBSD 5.1 raise "Symbol not found" here.)
| * doc: Cosmetic change for `release.org'.Ludovic Courtès2013-04-091-1/+1
| | | | | | | | * doc/release.org: Add #+STARTUP.
| * Update `THANKS'.Ludovic Courtès2013-04-091-0/+2
| |
| * update NEWSAndy Wingo2013-04-091-22/+14
| | | | | | | | * NEWS: Updates.
| * fix stime patch for HAVE_TIMES removalAndy Wingo2013-04-091-3/+14
| | | | | | | | | | | | * libguile/stime.c (scm_init_stime): Fix previous patch. At this point in the source, we definitely have a run-time function, but don't necessarily have a real-time function.
| * simplify configure checks for functionality provided by gnulibAndy Wingo2013-04-092-27/+4
| | | | | | | | | | | | | | * configure.ac: Remove checks for pipe, stftime, times, and select, as our Gnulib modules already ensure they are provided. * libguile/stime.c: Rely on gnulib providing `times'.
| * Minor 'THANKS' fix.Mark H Weaver2013-04-091-1/+1
| |
| * Fix alignment in 'THANKS'.Mark H Weaver2013-04-091-1/+1
| |
| * Update bug report section of 'THANKS'.Mark H Weaver2013-04-091-0/+4
| |
| * Update 'THANKS'.Mark H Weaver2013-04-091-0/+8
| |
| * Manual: Don't promise to signal an error for an illegal 'letrec'.Mark H Weaver2013-04-091-2/+2
| | | | | | | | | | | | | | | | Reported by Nikita Karetnikov <nikita@karetnikov.org>. * doc/ref/api-binding.texi (Local Bindings): Remove the incorrect claim that improperly accessing a letrec-bound variable during evaluation of its initializers will necessarily cause an error to be signalled.
| * tests: Skip IPv6 socket tests when OS support is missing.Ludovic Courtès2013-04-091-1/+10
| | | | | | | | | | | | | | | | Reported by Samuel Thibault <samuel.thibault@gnu.org> and Peter Simons <simons@cryp.to>. * test-suite/tests/00-socket.test ("AF_INET6/SOCK_STREAM"): Throw `unresolved' when `bind' throws EADDRNOTAVAIL.
| * Update 'NEWS'.Mark H Weaver2013-04-081-9/+3
| |
| * Update 'NEWS'.Mark H Weaver2013-04-081-0/+7
| |
| * Consume a peeked EOF at the REPL.Mark H Weaver2013-04-081-5/+2
| | | | | | | | * module/system/repl/repl.scm (meta-reader): Consume peeked EOF.
| * Miscellaneous 'sendfile' fixes and improved tests.Mark H Weaver2013-04-082-33/+53
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/filesys.c (scm_sendfile): In Linux-style sendfile(2) code, if EINTR or EAGAIN occurs, set result to 1 (not 0) so that we actually keep going. In non-sendfile(2) code, deal gracefully with short reads due to EOF. * test-suite/tests/filesys.test ("sendfile"): Use 'let*' to guarantee the needed order of operations: write (test-file) and then read it. Add code to check the written data (not just the returned length) in all tests, including the cases that hit EOF prematurely.
| * Update 'NEWS'.Mark H Weaver2013-04-071-76/+159
| |
| * Change `sendfile' to loop until everything has been sent.Ludovic Courtès2013-04-073-74/+114
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/filesys.c (scm_sendfile)[HAVE_SYS_SENDFILE_H && HAVE_SENDFILE]: Compare RESULT with C_COUNT. Loop until C_COUNT bytes have been sent. * doc/ref/posix.texi (File System): Update the description. Explain the new semantics. * test-suite/tests/filesys.test ("sendfile"): Rewrite using `pass-if-equal'. Check the return value for all the tests. ["file with offset past the end", "file with offset near the end"]: New tests.
| * Remove outdated and misplaced "Included Guile Modules" node from manual.Mark H Weaver2013-04-071-122/+1
| | | | | | | | | | * doc/ref/api-modules.texi (Included Guile Modules): Remove. (Using Guile Modules): Fix cross reference.
| * Clarify 'file-encoding' docs: heuristics may be improved later.Mark H Weaver2013-04-071-14/+22
| | | | | | | | | | | | | | | | | | | | * doc/ref/api-evaluation.texi (Character Encoding of Source Files): Mention UTF-8 as another common encoding used for Scheme source files, and that it is used by default. Change the description to leave open the possibility of adding additional heuristics in the future. Mention that if the coding declaration is in a #!-style block comment, it must be the first such comment in the file. Mention the '#:guess-encoding' keyword argument.