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

9 commits

Author SHA1 Message Date
Andy Wingo
94ff26b96b 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.
2009-08-12 16:34:05 +02:00
Jose A. Ortega Ruiz
aa49787b5e Improved handling of callers cache in (system xref).
* We cache callees in each module, and keep a list of modified
    ('tainted') modules, which is used to reconstruct the callers
    database incrementally.
  * `procedure-callers' now returns an a-list, keyed by module name.
2009-04-04 11:55:50 -07:00
Andy Wingo
6ecae97fb8 fix duplicates in procedure-callers
* module/system/xref.scm (ensure-callers-db): OK! Since we can see the
  same variable twice, e.g. in different modules, keep a unified hash of
  seen vars and modules. Prevents duplicates in procedure-callers.
2009-03-28 22:21:00 -07:00
Andy Wingo
154a611669 fix spurious duplicates in procedure-callees and callers
* module/system/xref.scm (program-callee-rev-vars): It's possible to get
  duplicates when combining callees of inner procedures, so ignore dups.
  Quadratic, boo.
2009-03-28 21:57:47 -07:00
Andy Wingo
e0a3ad670b rework procedure-callers to stay correct as callees are redefined
* module/system/xref.scm (procedure-callers): Rework to calculate the
  callers of a *variable*, not of a value. This is because the
  module-observers only get fired when the module changes, not with the
  variables change values. Also accept either a variable, a symbol
  (resolved in the current module), or a modname . symname pair.
2009-03-18 01:49:28 +01:00
Andy Wingo
7eba9c99c2 doubly-weak callers db
* module/system/xref.scm (ensure-callers-db): Store the callers db as a
  doubly-weak hash table.
2009-03-18 00:46:16 +01:00
Andy Wingo
b190790255 implement procedure-callers
* module/system/xref.scm: Implement procedure-callers, as the inverse of
  procedure-callees, with a cache invalidated by changes in modules.

* module/ice-9/boot-9.scm (module-use!): Don't poke module observers when
  module-use! is called for an already-used module.
2009-03-18 00:44:26 +01:00
Andy Wingo
4f96d42b2d add xref stub for interpreted procedures
* module/system/xref.scm (hacky-procedure-callees): Add a
  procedure-callees implementation for procedures with source, that
  currently does nothing. Not sure what to do, going into the future.
2009-03-17 23:16:35 +01:00
Andy Wingo
e04894e1ac add xref.scm
* module/system/xref.scm: New module, will provide callers/callees info.

* module/Makefile.am (SOURCES): Add xref.scm.
2009-03-17 23:11:56 +01:00