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

5410 commits

Author SHA1 Message Date
Andy Wingo
13906f976e lazily load meta info, for less consage
* module/system/vm/assemble.scm (make-meta, codegen): Hide the "meta"
  information -- the names of the bindings, source info, procedure
  properties, etc -- behind a lambda. This way, loading up a program
  conses less, because the metadata stays as mmap'd code until it is
  needed.

* libguile/vm-i-loader.c (load-program): Adjust load-program to expect
  the metadata to be a program.

* module/system/vm/program.scm (program-bindings, program-sources)
  (program-properties): Adjust to new meta format.
2008-09-08 01:03:34 +02:00
Andy Wingo
6c289afe76 macro-transformer recognizes compiled macros
* libguile/macros.c (macro-transformer): Recognize compiled as well as
  interpreted transformer procedures.
2008-09-07 23:13:52 +02:00
Andy Wingo
3633ff4e95 print compiled macros correctly
* libguile/macros.c (macro_print): Print macros whose code is a program
  as non-primitive. (Already, primitive-macro? would return #f.)
2008-09-07 22:27:19 +02:00
Andy Wingo
80b5909ca8 allow boot-9.go load if available
* libguile/init.c (scm_load_startup_files): Don't specify the .scm
  suffix, so as to allow loading a boot-9.go if appropriate.
2008-09-07 22:27:19 +02:00
Andy Wingo
7e58032880 make thunk? understand programs
* libguile/procs.c (thunk?): Return #t for thunk programs.
2008-09-07 22:27:18 +02:00
Andy Wingo
73dea589ca module-variable accesses pre-module-obarray if module is #f
* libguile/modules.c (module-variable): If module is #f, access the
  pre-modules-array. This is so that nested-ref can work before the
  module system is booted, I think.

  Of course all of these dependency lines during bootstrap are just to
  make sure the system can be booted properly, either interpreted or
  compiled, so there's no one right way: there are many ways that could
  work.
2008-09-07 22:27:18 +02:00
Andy Wingo
3aabb7b793 make late-variable-{ref,set} work before module system boot
* libguile/vm-i-system.c (late-variable-ref, late-variable-set): If the
  module system isn't booted, do a simple scm_lookup. In the -ref case,
  actually cache the variable location (doh!).
2008-09-07 22:27:18 +02:00
Andy Wingo
ee79dfab3d update .gitignore files
* .gitignore:
* libguile/.gitignore: Update
2008-09-07 22:14:18 +02:00
Andy Wingo
22f4ee4882 make primitive-load-path load compiled files if available
* libguile/load.h: Update scm_search_path prototype.

* libguile/load.c: Include vm.h for load-compiled/vm. Not sure if this is
  bad wrt modularity.
  (scm_c_string_has_an_ext): New private helper.
  (scm_search_path): Add an extra optional arg, `require_exts'; if true,
  require that the returned file name have one of the given extensions.
  Changes the C API, but not the scheme API.
  (scm_sys_search_load_path): Adapt to scm_search_path API change.
  (primitive-load-path): Here is the craziness: load a compiled file if
  found and newer than the corresponding (or not) source file.
  (scm_init_load): Define %load-compiled-extensions as the list of
  extensions denoting compiled files; defaults to '(".go").
2008-09-02 11:00:32 -07:00
Andy Wingo
90b0be2028 move up some initializations in the vm
* libguile/vm.c: Move 'vm-run, 'vm-error, 'debug sym initialization up to
  the bootstrap phase, so they are ready if load-compiled/vm is called
  before (system vm vm) is loaded.
2008-09-02 11:00:32 -07:00
Andy Wingo
c09346521e Fix compilation #ifndef STACK_CHECKING.
* libguile/debug.c (scm_debug_options): Fix compilation #ifndef
  STACK_CHECKING.
2008-09-02 10:30:39 -07:00
Andy Wingo
5c4926209f ditch the 8-bit compiled form of program parameters
* libguile/vm-i-loader.c (load-program):
* module/system/vm/assemble.scm (dump-object!): There are cases in which
  we use the 16-bit representation for program params (nargs, nexts,
  etc), but the actual 16-bit number actually fits into 8 bits -- which
  is then misinterpreted by the loader as the 8-bit form. So ditch the
  8-bit form entirely (it was never much of an optimization), and just
  use the 16-bit form. Make sure to clear out all your .go files before
  recompiling this one!
2008-09-02 10:30:39 -07:00
Andy Wingo
7950b4cffb fix a bug loading functions with 8 or more arguments
* libguile/vm-i-loader.c: A combination of superstition and a bugfix:
  make sure that we treat bits as being of a type as wide as we think it
  is, and, more importantly, allow for programs with 8 <= nargs < 16.
2008-09-02 10:30:39 -07:00
Andy Wingo
e0b20b68b0 shamefully disable some more gc asserts
* libguile/gc-freelist.c: Disable some more asserts. I have no idea why
  they're hitting, however.
2008-08-27 17:19:41 -07:00
Andy Wingo
1976ad74b8 fix casting-pointers-to-ints bug
* libguile/vm.c: Cast pointers to intptr_t, not int.

Patch from C. K. Jester-Young <cky944 <at> gmail.com>.
2008-08-26 13:48:19 -07:00
Andy Wingo
b264227691 fetch an inum's bits into a scm_bits_t, not an int
* libguile/vm-i-scheme.c (FUNC1): Remove, cause it's not used.
  (FUNC2): Don't assume an inum can fit into an int, use scm_bits_t
  instead. In reality though we should probably do use different checks,
  i.e. for multiplication probably we overflow. (That would be a bug.)

Based on a patch by C. K. Jester-Young <cky944 <at> gmail.com>.
2008-08-26 13:48:12 -07:00
Andy Wingo
05ddc073c3 disable gc statistics asserts
* libguile/gc.c: Disable the statistics asserts; see
  http://thread.gmane.org/gmane.lisp.guile.devel/7505
2008-08-26 13:29:55 -07:00
Andy Wingo
fdc0a82263 merge from guile master
Had to fix up .gitignore for some conflicts.
2008-08-26 12:51:19 -07:00
Ludovic Courtès
582a4997ab Use $(GCC_CFLAGS) for `-Werror' et al. so that it's not used to compile
Gnulib code.
2008-08-25 22:11:53 +02:00
Han-Wen Nienhuys
4b7513463d Fix 2 indentation nitpicks. 2008-08-21 23:21:57 -03:00
Han-Wen Nienhuys
1f5844000e Style nitpicks: space before () in function call. 2008-08-21 23:16:20 -03:00
Andy Wingo
83495480e8 merge guile-vm into libguile itself
* ice-9/boot-9.scm: Only define load-compiled as #f if it's not already
  defined, which won't normally be the case.

* libguile/guile-vm.c: Removed, there's no more guile-vm binary.

* libguile/frames.c: (with change frame? -> heap-frame?)
* libguile/frames.h:
* libguile/instructions.c:
* libguile/instructions.h:
* libguile/objcodes.c:
* libguile/objcodes.h:
* libguile/programs.c:
* libguile/programs.h:
* libguile/vm-bootstrap.h: (was bootstrap.h)
* libguile/vm-engine.c: (was vm_engine.c)
* libguile/vm-engine.h: (was vm_engine.h)
* libguile/vm-expand.h: (was vm_expand.h)
* libguile/vm-i-loader.c: (was vm_loader.c)
* libguile/vm-i-scheme.c: (was vm_scheme.c)
* libguile/vm-i-system.c: (was vm_system.c)
* libguile/vm.c:
* libguile/vm.h: These files moved here from src/, as guile-vm is now a
  part of libguile.

* libguile/init.c: Bootstrap the VM. Yay!

* libguile/Makefile.am: The necessary chicanery here.

* module/system/vm/Makefile.am:
* module/system/vm/bootstrap.scm:
* module/system/vm/frame.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm:

* pre-inst-guile-env.in: Add builddirs to the load path; add module/ to
  the path in the empty-$GUILE_LOAD_PATH case as well.

* src/Makefile.am: Moved out everything except guilec and guile-disasm,
  which probably should be moved to the scripts directory?

* testsuite/Makefile.am: Update to find guile-vm in the right place.

* module/system/vm/Makefile.am:
* module/system/vm/bootstrap.scm: Removed bootstrap.scm, scm_init_guile
  handles the bootstrapping for us.

* module/system/vm/frame.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm: Call the init functions in libguile; should
  fix at some point to avoid the dlopen?
2008-08-21 18:39:30 -07:00
Ludovic Courtès
417566ebc9 Never define _GNU_SOURCE' explicitly since AC_USE_SYSTEM_EXTENSIONS'
takes care of it.

Conflicts:

	ChangeLog
	configure.in
	libguile/eval.c
	libguile/srfi-14.c
	libguile/threads.c
2008-08-20 19:31:46 +02:00
Ludovic Courtès
4a1db3a91f Add ChangeLog and NEWS entry for the GOOPS `class-redefinition' memory
corruption fix.
2008-08-19 19:13:39 +02:00
Ludovic Courtès
bb764c0e3c Complete fix of `hell' allocation in GOOPS. 2008-08-19 19:08:29 +02:00
Han-Wen Nienhuys
408bcd99d3 Fix sizeof() nitpick for goops corruption. 2008-08-18 11:19:59 -03:00
Han-Wen Nienhuys
5bfb683e12 Make marked conservatively statistic accumulative. 2008-08-16 15:34:04 -03:00
Han-Wen Nienhuys
676d9cc553 If realloc() fails in scm_realloc, then do a complete GC with complete
sweep directly.
2008-08-16 15:20:55 -03:00
Han-Wen Nienhuys
40945e5e9f Add a statistic for tracking how many cells are marked conservatively.
This allows an informed choice for deciding how many segments to
create.  After startup, ~2% of the cells are scanned conservatively.
2008-08-16 15:03:48 -03:00
Han-Wen Nienhuys
82ae1b8eb3 Garbage collection cleanup.
* New file gc-segment-table.c: hold code for the segment table.

* Remove data that might be out of date; remove
  scm_i_adjust_min_yield().  We don't store min_yields, since they
  are only accurate at one point in time (when the sweep finishes). 
  We decide the min yield at that point from min_yield_fraction and
  freelist->collected / freelist->swept

* Introduce scm_i_gc_heap_size_delta() replacing
  scm_i_gc_grow_heap_p().
  
* Remove foo_1 fields containing penultimate results.

* After GC, count mark bit vector to discover number of live
  objects. This simplifies hairy updates.

* Many formatting and layout cleanups.

* Fix in scm_i_sweep_card(): return the length of free_list returned,
  rather than number of deleted objects.

* For mtrigger GCs: do not also run a full sweep after the gc() call, as
  this is inconsistent with lazy sweeping.

* Remove scm_i_make_initial_segment().

* Use calloc in scm_i_make_empty_heap_segment() to save on
  initialization code.

* New function scm_i_sweep_for_freelist() which sweeps, with proper
  statistic variable updates.

* New segments are conceptually blocks with 100% reclaimable cells.

* Remove some useless constants/comments: SCM_HEAP_SIZE,
  SCM_INIT_HEAP_SIZE, SCM_EXPHEAP, SCM_HEAP_SEG_SIZE

* Do not increment scm_cells_allocated() from the
  scm_[double]cell(). This would be a race condition.

* Move some deprecation checks in separate functions to not distract
  from main code flow.
2008-08-16 13:57:23 -03:00
Han-Wen Nienhuys
b474ac33ee Remove comments about removed variables. 2008-08-16 13:27:17 -03:00
Han-Wen Nienhuys
d09752ffd1 Introduce scm_i_marking to detect when GC mark bits are touched
outside of marking stage.
2008-08-16 13:21:42 -03:00
Han-Wen Nienhuys
e89b7b3625 Remove unused macro UNMARKED_CELL_P() 2008-08-16 13:21:32 -03:00
Han-Wen Nienhuys
569aa529d5 Use word_2 to store mark bits for freeing structs and vtables in the
correct order.

This ensures that we only use GC Marks during the actual GC Mark.
2008-08-16 13:21:21 -03:00
Han-Wen Nienhuys
51ef99f7fa Fix memory corruption issue with hell[] array: realloc/calloc need to
factor in sizeof(scm_t_bits)
2008-08-16 02:32:00 -03:00
Han-Wen Nienhuys
01621bf62e Include min-yields in gc-stats output. 2008-08-14 02:16:41 -03:00
Han-Wen Nienhuys
2072309c1c Whitespace and formatting fixes.
Conflicts:

	libguile/gc-freelist.c
	libguile/gc-segment.c
	libguile/gc.h
2008-08-14 01:51:24 -03:00
Neil Jerram
76dae88158 Fix misleading output from `(help rationalize)'
* numbers.c (scm_rationalize): Update docstring to match the
	manual (which is more correct).  Change argument "err" to "eps",
	also to match the manual.
2008-08-03 00:27:32 +01:00
Andy Wingo
d351811347 Fixes to make guile-vm compile in guile source tree
* INSTALL: Updated.
* m4/gnulib-cache.m4: Regenerated.

* Makefile.am: Spelling fix.

* guilec.mk:
* src/Makefile.am:
* src/vm.c: Update to actually work inside a guile source tree.

* libguile/Makefile.am: Don't error on warnings in the flex-generated
  c-tokenize function.
2008-08-02 12:17:27 +02:00
Neil Jerram
2b3df509f6 ChangeLog for "Improved MIPS/Linux gc_os_dep.c definitions" 2008-07-17 22:26:41 +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
c0a658c4db Improved MIPS/Linux gc_os_dep.c definitions
From Thiemo Seufer <ths@networkno.de>:

	* gc_os_dep.c (CPP_WORDSZ, ALIGN_DOUBLE, DATAEND,
	DYNAMIC_LOADING): Added #defines.
	(_fdata, _end): Added declarations.
	(DATASTART): Use _fdata instead of __data_start.
	(STACKBOTTOM): Changed from 0x80000000 to 0x7fff8000.
2008-07-12 19:33:21 +01:00
Ludovic Courtès
071bb6a840 Add `scm_c_symbol_length ()'. 2008-07-05 20:16:12 +02:00
Ludovic Courtès
b6137ed741 Don't declare scm_i_locale_mutex' as SCM_INTERNAL'. 2008-07-04 22:22:06 +02:00
Ludovic Courtès
3e28462ffb Fix `SCM_INTERNAL' with GCC 4.3. 2008-07-04 22:02:56 +02:00
Ludovic Courtès
47871d5a16 Modernize Automake files. 2008-06-28 22:15:52 +02:00
Ludovic Courtès
95c6523b03 Disable type-checking of `SCM_UNPACK' for the broken HP compilers. 2008-06-28 20:31:01 +02:00
Ludovic Courtès
6eadcdab98 Work around `#define except' on Tru64. 2008-06-02 21:43:07 +02:00
Ludovic Courtès
102dbb6f6c Add `SCM_INTERNAL' macro, use it. 2008-05-31 23:21:02 +02:00
Neil Jerram
241d9cea20 Delete trailing whitespace. 2008-05-15 00:00:57 +01:00