| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (<arity>): Add new "has-closure?"
flag.
(begin-kw-arity, pack-arity-flags, write-arities): Write
"elided-closure?" flag into binary. A negative flag for compat
reasons.
* module/system/vm/debug.scm (elided-closure?, arity-has-closure?): Add
arity-has-closure? accessor.
* module/system/vm/frame.scm (frame-call-representation): Count from 0
for callees with elided closures.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pointer dereferencing instructions will keep the pointer alive by
referencing a containing object.
* module/language/cps/compile-bytecode.scm:
* libguile/vm-engine.c:
* module/language/cps/cse.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/types.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm: Rename instructions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/vm-engine.c (gc-pointer-ref/immediate)
(gc-pointer-set!/immediate): New instructions.
(SP_REF_PTR, SP_SET_PTR): New helper definitions.
* libguile/vm.c (SLOT_DESC_LIVE_GC): Rename from SLOT_DESC_LIVE_SCM, as
it can indicate GC-protected raw pointers also.
(scm_i_vm_mark_stack): Adapt.
* module/system/vm/assembler.scm (write-arities):
* module/system/vm/debug.scm (arity-definitions): Add gcptr
representation. This is a binary-incompatible change!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/frames.c (enum stack_item_representation):
(scm_to_stack_item_representation):
(scm_frame_local_ref, scm_frame_local_set_x): Support for S64
representations.
* libguile/frames.h (union scm_vm_stack_element): Add signed 64-bit
integer field.
* libguile/vm-engine.c (scm->s64, s64->scm, load-s64): New
instructions.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
* module/language/cps/effects-analysis.scm:
* module/language/cps/slot-allocation.scm (compute-var-representations)
(compute-needs-slot, allocate-slots):
* module/language/cps/utils.scm (compute-constant-values):
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
Add support for new primcalls.
* module/language/cps/types.scm (&s64): New type.
(&s64-min, &s64-max, &u64-max): New convenience definitions.
(&range-min, &range-max): Use &s64-min and &u64-max names.
(scm->s64, load-s64, s64->scm): Add support for new primcalls.
* module/system/vm/assembler.scm (emit-scm->s64, emit-s64->scm)
(emit-load-s64): New exports.
* module/system/vm/assembler.scm (write-arities): Support for s64
slots.
* module/system/vm/debug.scm (arity-definitions): Support for s64
slots.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/frames.c (enum stack_item_representation)
* libguile/frames.c (scm_to_stack_item_representation):
(scm_frame_local_ref, scm_frame_local_set_x): Support 'u64 slots.
* libguile/frames.h (union scm_vm_stack_element): Add as_u64 member.
* libguile/vm-engine.c (SP_REF_U64, SP_SET_U64): New helpers.
(scm->u64, u64->scm): New instructions.
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
Scalar replacement for u64->scm and scm->u64.
* module/language/cps/effects-analysis.scm (scm->u64, u64->scm): Add
cases.
* module/language/cps/slot-allocation.scm (compute-var-representations):
(allocate-slots): Represent the result of scm->u64 as a "u64" slot.
* module/language/cps/types.scm (&u64): New type.
(scm->u64, u64->scm): Add support for these ops.
* module/system/vm/assembler.scm (write-arities):
* module/system/vm/debug.scm (arity-definitions): Support u64
representations.
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps/compile-bytecode.scm (compile-function): Always
define a 'closure binding in slot 0.
* module/system/vm/frame.scm (available-bindings): No need to futz
around not having a closure binding.
* module/system/vm/debug.scm (arity-arguments-alist): Expect a closure
binding.
* test-suite/tests/rtl.test: Emit definitions for the closure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (emit-definition): Add representation
field.
(write-arities): Emit representations into the arities section.
* module/system/vm/debug.scm (arity-definitions): Read representations.
* module/system/vm/frame.scm (<binding>): Add representation field and
binding-representation getter.
(available-bindings): Pass representation to make-binding.
(frame-binding-set!, frame-binding-ref, frame-call-representation):
Pass representation to frame-local-ref / frame-local-set!.
* test-suite/tests/rtl.test: Update definition instructions.
* module/language/cps/slot-allocation.scm ($allocation): Add
representations field.
(lookup-representation): New public function.
(allocate-slots): Pass representations to make-$allocation.
* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
emit-definition change.
* libguile/frames.h:
* libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Take
representation argument.
(scm_to_stack_item_representation): New internal helper.
|
|
|
|
|
| |
* module/system/vm/debug.scm (source-line-for-user): Fix to allow for
unknown lines.
|
|
|
|
| |
* module/system/vm/debug.scm (arity-code): New interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (arity-definitions): New interface.
* module/system/vm/program.scm (make-binding, binding:boxed?)
(binding:index, binding:start, binding:end): Remove.
(binding:definition-offset, binding:slot): Add.
(program-arity-bindings-for-ip): Rename from program-bindings-for-ip,
as it gives all definitions in an arity. The user will have to do
data-flow analysis to recover the set of variables that are actually
available at any given point.
(arity->arguments-alist): Remove crufty code.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (put-uleb128, put-sleb128)
(port-position): Lift out these helpers.
(arity-header-len, write-arities, link-arities): Add "nlocals" to the
arity headers. Write names of all locals into the arities section,
not just the arguments. Write them as uleb128's instead of uint32's,
to save space.
* module/system/vm/debug.scm (arity-header-len, arity-nlocals*)
(arity-nlocals, arity-locals, arity-arguments-alist): Adapt to new
encoding for arities.
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (meta-arities-size, write-arity-links):
* module/system/vm/debug.scm (arity-keyword-args)
(arity-arguments-alist): Rewrite to put they keyword literals link
first. Unfortunately requires a recompile :/
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (arity-keyword-args, find-program-arity):
New exports.
* module/system/vm/frame.scm (frame-call-representation): Prefer to use
the frame IP to get the procedure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"RTL" didn't make any sense, and now that there's no other bytecode to
disambiguate against, just call it bytecode.
* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/cps/arities.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/primitives.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/spec.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/rtl.scm:
* module/language/rtl/spec.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* module/system/repl/common.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* test-suite/tests/cross-compilation.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test:
* test-suite/vm/run-vm-tests.scm: Fixups.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/loader.c:
* libguile/loader.h: Rename from objcodes.[ch].
* module/system/vm/loader.scm: Rename from objcode.scm.
* libguile/Makefile.am:
* libguile/gsubr.c:
* libguile/init.c:
* libguile/procs.c:
* libguile/vm.c:
* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/rtl/spec.scm:
* module/system/base/target.scm:
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/objcode.scm:
* test-suite/tests/compiler.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test: Adapt.
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (find-program-minimum-arity): Rename from
program-minimum-arity.
* module/system/vm/program.scm (program-minimum-arity): Rename from
rtl-program-minimum-arity.
* libguile/programs.c (scm_i_program_arity): Adapt.
|
|
|
|
|
| |
* module/system/vm/debug.scm (find-program-properties): Use binary
search.
|
|
|
|
|
| |
* module/system/vm/debug.scm (find-program-docstring): Use binary
search.
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (pack-arity-flags):
(write-arity-headers): Add a flag to indicate that an arity is part of
a case-lambda, so that we can use binary search to find arities.
* module/system/vm/debug.scm (is-in-case-lambda?)
(arity-is-in-case-lambda?, find-first-arity): Use binary search.
|
|
|
|
|
| |
* module/system/vm/debug.scm (binary-search): New helper.
(find-elf-symbol): Use binary search.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm: Export program-debug-info-size.
* module/system/vm/traps.scm (frame-matcher): Remove stack program
case. Use absolute frame-instruction-procedure to match if
match-code?.
(program-last-ip): Use (system vm debug) interfaces.
(program-sources-by-line): Use program-sources, as
program-sources-pre-retire will go away soon. Return absolute
addresses.
|
|
|
|
|
| |
* module/system/vm/debug.scm (program-minimum-arity): Be more precise
with case-lambdas.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/ice-9/session.scm (procedure-arguments): Add an rtl-program?
case.
* module/system/vm/debug.scm (arity-arguments-alist): Use the order that
session.test expects.
* test-suite/tests/session.test ("procedure-arguments"): Adapt tests
with keywords for the new starting-with-the-procedure numbering of
locals.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/gsubr.h:
* libguile/gsubr.c (scm_i_primitive_call_ip):
* libguile/programs.c (scm_primitive_call_ip): Adapt to return an
absolute address.
* module/system/vm/assembler.scm (write-arity-headers): Adapt to write
byte addresses (relative to the text base).
* module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Return
absolute addresses, instead of word offsets relative to the text
base.
(find-first-arity): Adapt for absolute addresses.
* module/system/vm/program.scm (program-arguments-alist): Adapt for
arity-low-pc / arity-high-pc absolute addresses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/frames.c (scm_frame_source): Instead of assuming that
scm_frame_procedure is correct, use the IP to get the source.
(scm_frame_instruction_pointer): Return an absolute value instead of
assuming that slot 0 is correct. (It isn't, when preparing for a tail
call.)
* libguile/programs.h:
* libguile/programs.c (scm_find_source_for_addr): New internal helper.
* module/system/repl/debug.scm (print-registers): Readably print
absolute instruction pointers.
* module/system/vm/coverage.scm: Complete rewrite to use absolute IP's.
We can't assume that frame-procedure is cheap if it is correct, or
correct if it is cheap. Anyway using the address is better anyway.
(coverage-data->lcov): Disable per-function info temporarily.
(loaded-modules, module-procedures, closest-source-line)
(closed-over-procedures): Remove these. Instead of going from
procedures to source info, now we go from ELF image to source info.
* module/system/vm/debug.scm (debug-context-length): New interface.
* module/system/vm/program.scm (source-for-addr): New internal helper.
|
|
|
|
|
|
|
|
| |
* module/system/vm/objcode.scm:
* libguile/objcodes.c (scm_all_mapped_elf_images): New proc.
* module/system/vm/debug.scm (fold-all-debug-contexts):
(fold-source-locations): New public interfaces.
|
|
|
|
|
| |
* module/system/vm/debug.scm (find-program-sources): Manually set the pc
of the first result in a function.
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (link-docstrs): Write pc offsets as
byte addresses. Works better with native code.
* module/system/vm/debug.scm (find-program-docstring): Fix the linear
search. How embarassing!
|
|
|
|
|
| |
* module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Implement
these exports.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/frames.c (scm_frame_source, scm_frame_instruction_pointer):
Fix to work with RTL programs.
* module/system/vm/debug.scm (find-debug-context): Allow for the
possibility of there being no ELF image.
(find-program-debug-info, find-program-arities)
(program-minimum-arity, find-program-docstring)
(find-program-properties, find-source-for-addr)
(find-program-die, find-program-sources): Don't bail if we couldn't
get the debug context.
* module/system/vm/frame.scm (frame-next-source)
(frame-call-representation): Allow RTL programs.
* module/system/vm/program.scm (program-arguments-alist): Placeholder
implementation for RTL programs.
(program-arguments-alists): Don't bail if we couldn't get the
arities.
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (find-program-sources): If there is no
source location before the low-pc of the procedure we're grovelling
for, we were skipping the source loc info. Fix that.
* module/system/vm/program.scm (write-program): Get source info for
anonymous RTL functions.
(program-sources, program-sources-pre-retire): Provide program
counters relative to the beginning of the procedure.
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (<source>, source-pre-pc)
(source-post-pc, source-file, source-line, source-column)
(source-line-for-user): New data type for source location
information.
(find-source-for-addr, find-program-sources): New procedures to get
source location information for a particular address.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/scripts/disassemble.scm (disassemble): Update to work with
RTl (and only RTL, as that's the future).
* module/system/vm/debug.scm (for-each-elf-symbol): New public
interface.
(debug-context-from-image): New helper.
(find-debug-context): Use the helper.
* module/system/vm/disassembler.scm (disassemble-image): New public
interface.
|
|
|
|
|
|
|
|
| |
* libguile/programs.c (parse_arity): Lookup rtl-program-minimum-arity
from (system vm debug).
* module/system/vm/debug.scm (find-first-arity): Fix the linear search.
Whoops!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/assembler.scm (link-procprops, link-objects): Arrange
to write procedure property links out to a separate section.
* libguile/procprop.c (scm_procedure_properties):
* libguile/programs.h:
* libguile/programs.c (scm_i_rtl_program_properties):
* module/system/vm/debug.scm (find-program-properties): Wire up
procedure-properties for RTL procedures. Yeah! Fistpumps! :)
* module/system/vm/debug.scm (find-program-debug-info): Return #f if the
string is "", as it is if we don't have a name. Perhaps
elf-symbol-name should return #f in that case...
* test-suite/tests/rtl.test: Add some tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/procprop.h:
* libguile/procprop.c (scm_procedure_documentation): Move here from
procs.c, and to make the logic more similar to that of procedure-name,
which allows RTL programs to dispatch to rtl-program-documentation.
* libguile/programs.c (scm_i_rtl_program_documentation):
* libguile/programs.h:
* module/system/vm/program.scm (rtl-program-documentation): New
plumbing.
* module/system/vm/debug.scm (find-program-docstring): New interface to
grovel ELF for a docstring.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/procprop.c (scm_i_procedure_arity): Allow RTL programs to
dispatch to scm_i_program_arity.
* libguile/programs.c (scm_i_program_print): Refactor reference to
write-program.
(scm_i_rtl_program_minimum_arity): New procedure, dispatches to
Scheme.
(scm_i_program_arity): Dispatch to scm_i_rtl_program_minimum_arity if
appropriate.
* module/system/vm/debug.scm (program-minimum-arity): New export.
* module/system/vm/program.scm (rtl-program-minimum-arity): New internal
function.
(program-arguments-alists): New helper, implemented also for RTL
procedures.
(write-program): Refactor a bit, and call program-arguments-alists.
* test-suite/tests/rtl.test ("simply procedure arity"): Add tests that
arities make it all the way to cold ELF and back to warm Guile.
|
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (<arity>): New object, for reading
arities. Unlike <arity> in the assembler, this one only holds on to a
couple of pointers, and doesn't even load in argument names. Unlike
the arity lists in (system vm program), it can load in names. Very
early days but it does seem to work.
(find-program-arities, arity-arguments-alist): New higher-level
interfaces.
|
|
|
|
|
|
|
| |
* module/Makefile.am:
* module/system/vm/disassembler.scm: New module.
* module/system/repl/command.scm (disassemble): Work with RTL programs.
|
|
|
|
|
|
|
|
|
|
| |
* module/Makefile.am:
* module/system/vm/debug.scm: New module.
* module/system/vm/elf.scm (elf-section-by-name): New helper.
(elf-symbol-table-len): New helper.
* test-suite/tests/rtl.test: Add test for finding debug info.
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm: Remove.
* module/Makefile.am: Update.
* module/system/repl/debug.scm: Add some TODOs and a commented-out
function here.
|
|
|
|
|
| |
* module/system/vm/debug.scm (debug): Change to debug the current stack
instead of the last stack.
|
|
|
|
|
| |
* module/system/vm/debug.scm (debugger-repl): Errors reading debugger
args no longer drop us out of the debugger.
|
|
|
|
|
|
|
|
| |
* module/system/repl/repl.scm (prompting-meta-read): Use
call-with-error-handling.
* module/system/vm/debug.scm (call-with-error-handling): Add case for
#:on-error 'pass. Have the catch handler return the unspecified value.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/repl/repl.scm (prompting-meta-read): Catch and print
read errors here, returning unspecified in that case.
(start-repl): Don't enable the debugger while reading expressions.
Adapt with-backtrace to with-error-handling.
* module/system/vm/debug.scm (run-debugger, debugger-repl): No need to
take a stack, the frames vector is sufficient.
(call-with-error-handling, with-error-handling): New public utilities.
Notably they do not poke the-last-stack.
|
|
|
|
|
| |
* module/system/vm/debug.scm (frame->module): In which our author
misunderstands git's index.
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (frame->module): Actually bind frame-local
variables to values in the new anonymous module. Setting settable vars
should work too :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/repl/common.scm (*repl-level*): New public fluid.
(repl-prompt): If *repl-level* is a positive integer, add it to the
prompt.
* module/system/repl/repl.scm (start-repl): The `lang' argument is now
optional, and defaults to (current-language). New kwargs level and
welcome; level defaults to 0, or 1+ the existing level, and the
welcome is a boolean, true if level is 0. Parameterize *repl-level*
during the dynamic extent of this repl. Also, parameterize
the-last-stack to #f for the duration of this repl.
* module/system/vm/debug.scm (frame->module, debugger-repl): Stubs of a
recursive repl implementation. The idea is to be a repl in the lexical
context of the error; but it would be nice to be able to operate in
the module of the proc too, for example to export bindings. Hmm.
|
|
|
|
|
|
|
|
|
| |
* module/system/vm/debug.scm (*debug-input-port*):
(*debug-output-port*): New public fluids.
(run-debugger): Add some kwargs for input and output ports, defaulting
to the debug input and output ports.
(debug-pre-unwind-handler): Print to debug output port.
(debug): Untabify.
|
|
|
|
|
|
|
|
|
| |
* module/ice-9/boot-9.scm (top-repl): Map (debug) at the repl to (system
vm debug).
* module/system/vm/debug.scm (run-debugger, debugger-repl): Don't take
the index as an arg, for now anyway.
(debug): New wrapper.
|