summaryrefslogtreecommitdiff
path: root/module/system/xref.scm
AgeCommit message (Collapse)AuthorFilesLines
2023-02-24Remove unnecessary module imports.Ludovic Courtès1-1/+0
These were found with: make GUILE_WARNINGS='-W1 -Wunused-module' * module/ice-9/copy-tree.scm: * module/ice-9/eval-string.scm: * module/ice-9/getopt-long.scm: * module/ice-9/poll.scm: * module/ice-9/popen.scm: * module/ice-9/sandbox.scm: * module/ice-9/threads.scm: * module/sxml/apply-templates.scm: * module/sxml/simple.scm: * module/system/base/types.scm: * module/system/repl/command.scm: * module/system/repl/common.scm: * module/system/repl/coop-server.scm: * module/system/repl/debug.scm: * module/system/repl/error-handling.scm: * module/system/repl/repl.scm: * module/system/repl/server.scm: * module/system/vm/assembler.scm: * module/system/vm/disassembler.scm: * module/system/vm/dwarf.scm: * module/system/vm/elf.scm: * module/system/vm/frame.scm: * module/system/vm/inspect.scm: * module/system/vm/linker.scm: * module/system/vm/program.scm: * module/system/vm/trace.scm: * module/system/vm/trap-state.scm: * module/system/vm/traps.scm: * module/system/xref.scm: * module/texinfo/indexing.scm: * module/texinfo/plain-text.scm: * module/texinfo/reflection.scm: * module/texinfo/string-utils.scm: * module/web/client.scm: * module/web/http.scm: * module/web/request.scm: * module/web/response.scm: Remove imports of unused modules.
2018-05-14Remove backend support for cached-module-box et al.Andy Wingo1-1/+5
* module/language/cps/compile-bytecode.scm (compile-function): Remove unused assemblers for cached-module-box, cached-toplevel-box, and cache-current-module!. * module/language/cps/effects-analysis.scm (&cache): New memory kind. (cache-current-module!): Set &cache memory, not &box. (resolve-module, lookup-module, cache-ref, cache-set!): Add effect annotations. * module/system/vm/assembler.scm (emit-cache-current-module!) (emit-cached-toplevel-box, emit-cached-module-box): Remove assemblers. * module/system/vm/disassembler.scm (code-annotation, fold-code-range): Remove special cases for toplevel-box and module-box. * module/system/xref.scm (program-callee-rev-vars): Add a FIXME for the future.
2013-11-19rtl-program? -> program?Andy Wingo1-5/+4
* libguile/programs.c (scm_program_p): Rename from scm_rtl_program_p. Changes name also from rtl-program? to program?. * libguile/programs.h: * module/ice-9/session.scm: * module/language/tree-il/analyze.scm: * module/statprof.scm: * module/system/repl/command.scm: * module/system/repl/debug.scm: * module/system/vm/coverage.scm: * module/system/vm/disassembler.scm: * module/system/vm/frame.scm: * module/system/vm/program.scm: * module/system/vm/traps.scm: * module/system/xref.scm: Adapt.
2013-11-08Rewrite (system xref) to work with RTL programsAndy Wingo1-77/+66
* module/system/xref.scm (nested-procedures): New helper. (program-callee-rev-vars): Rewrite using fold-program-code and nested-procedures. (add-sources, forget-sources): Use match instead of pmatch. Use nested-procedures.
2013-10-17minimal RTL program support in (system xref)Andy Wingo1-2/+3
* module/system/xref.scm (procedure-sources*): Work with RTL programs.
2010-09-24system xref maintains source mapping for nested procedures tooAndy Wingo1-26/+53
* module/system/xref.scm (*closure-sources-db*): New global, like *sources-db* but for nested procedures. It's a separate map because these procs need to be treated differently in trap handlers -- you match on the bytecode, not on the program object. (add-source, forget-source): Take the db as an argument (the normal db or the closures db). (add-sources, forget-sources): Record sources for nested procedures to in *closures-db*. (untaint-sources, ensure-sources-db): Adapt for new closures db. (lookup-source-procedures): Factored out. (source-closures): New exported procedure, returns closures at the given source location.
2010-09-10new procedure: source-proceduresAndy Wingo1-1/+161
* module/system/xref.scm (source-procedures): New public procedure, gives the procedures defined at a given source location.
2010-09-10(system xref) uses module-submodulesAndy Wingo1-8/+19
* module/system/xref.scm (ensure-callers-db): Fix up to use module-submodules.
2010-04-24use nested-ref-module in (system xref)Andy Wingo1-3/+3
* module/system/xref.scm (program-callee-rev-vars): Use nested-ref-module instead of nested-ref.
2009-10-23de-nargs struct scm_objcode; procedure-property refactorAndy Wingo1-1/+1
* libguile/objcodes.h (struct scm_objcode): Remove nargs, nrest, and nlocs, as they are no longer needed. Also obviates the need for a padding word. * libguile/procs.c (scm_thunk_p): Use scm_i_program_arity for programs. * libguile/procprop.c (scm_i_procedure_arity): Use scm_i_program_arity for programs. (scm_procedure_properties, scm_set_procedure_properties_x) (scm_procedure_property, scm_set_procedure_property_x): Rework so that non-closure properties are stored directly in a weak hash, instead of needing a weak hash of "stand-in" closures to hold the properties. Fix docstrings also. * libguile/root.h (scm_stand_in_procs): Remove from the scm_sys_protects set. Actually with libGC, we should be able to store the elements of scm_sys_protects directly as global variables. * libguile/gc.c (scm_init_storage): Remove scm_stand_in_procs initialization. * libguile/programs.c (scm_i_program_arity): New private accessor, tries to determine the "minimum arity" of a program. * libguile/vm.c (really_make_boot_program): Adapt to changes in struct scm_objcode. * module/language/assembly.scm (*program-header-len*, byte-length): * module/language/assembly/compile-bytecode.scm (write-bytecode): * module/language/assembly/decompile-bytecode.scm (decode-load-program): * module/language/assembly/disassemble.scm (disassemble-load-program): Adapt to changes in objcode. * module/system/xref.scm (program-callee-rev-vars): Adapt to changes in assembly. * module/language/glil.scm: Remove nargs, nrest, and nlocs from glil-program. * module/language/glil/compile-assembly.scm (make-meta, glil->assembly): * module/language/glil/decompile-assembly.scm (decompile-toplevel): (decompile-load-program): Adapt to changes in GLIL and assembly. * module/language/tree-il/compile-glil.scm (flatten-lambda): Adapt to changes in GLIL. * test-suite/tests/asm-to-bytecode.test: Adapt to assembly and bytecode changes. * test-suite/tests/tree-il.test: Adapt to GLIL changes.
2009-09-24Partially revert e5f5113c21f396705d7479a570c96690135c9d36.Ludovic Courtès1-1/+1
The intent is to maintain the readability of `pmatch' invocations. * module/language/assembly/disassemble.scm (disassemble-load-program): Don't use wildcards in `pmatch' invocations, even when the matched elements are unused. * module/language/glil/decompile-assembly.scm (decompile-toplevel, decompile-load-program): Likewise. * module/system/xref.scm (program-callee-rev-vars): Likewise. * module/language/assembly.scm (byte-length): Likewise. * module/language/tree-il/compile-glil.scm (flatten): Likewise.
2009-09-21Remove unused variables in system/language.Ludovic Courtès1-1/+1
* module/language/assembly.scm (byte-length): Don't match unused record slots. * module/language/tree-il.scm (tree-il->scheme, post-order!, pre-order!): Likewise. * module/language/tree-il/analyze.scm (analyze-lexicals): Likewise. * module/language/tree-il/compile-glil.scm (flatten): Likewise. * module/language/assembly/disassemble.scm (disassemble-load-program): Don't match unused list elements. * module/language/glil/decompile-assembly.scm (decompile-toplevel, decompile-load-program): Likewise. * module/system/xref.scm (program-callee-rev-vars): Likewise. * module/language/assembly/compile-bytecode.scm (write-bytecode)[write-sized-loader]: Remove. * module/language/assembly/decompile-bytecode.scm (decode-load-program): Factorize `pad' variables. * module/language/ecmascript/base.scm (object->value/string, object->value/number)[v]: Remove. * module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove. * module/language/objcode/spec.scm (decompile-value)[nargs]: Remove. * module/system/repl/command.scm (time)[vms-start, vms-end]: Remove. * module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.
2009-08-12rework the vm support for wide stringsAndy Wingo1-1/+1
* 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-04-04Improved handling of callers cache in (system xref).Jose A. Ortega Ruiz1-32/+73
* 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-03-28fix duplicates in procedure-callersAndy Wingo1-4/+7
* 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-28fix spurious duplicates in procedure-callees and callersAndy Wingo1-8/+11
* 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-18rework procedure-callers to stay correct as callees are redefinedAndy Wingo1-48/+58
* 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-18doubly-weak callers dbAndy Wingo1-1/+1
* module/system/xref.scm (ensure-callers-db): Store the callers db as a doubly-weak hash table.
2009-03-18implement procedure-callersAndy Wingo1-6/+54
* 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-17add xref stub for interpreted proceduresAndy Wingo1-1/+5
* 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-17add xref.scmAndy Wingo1-0/+73
* module/system/xref.scm: New module, will provide callers/callees info. * module/Makefile.am (SOURCES): Add xref.scm.