bpt/guile.git
10 years agoFrame pointer points to local 0 instead of local 1
Andy Wingo [Sun, 17 Nov 2013 21:07:44 +0000 (22:07 +0100)]
Frame pointer points to local 0 instead of local 1

* libguile/frames.h: Change so that fp points at local 0 instead of
  local 1, and clean up a bit.
  (struct scm_vm_frame): Remove program, and rename stack to locals.
  (SCM_FRAME_DATA_ADDRESS): Remove; it was redundant with
  SCM_FRAME_LOWER_ADDRESS.
  (SCM_FRAME_STACK_ADDRESS): Remove; replace with the new
  SCM_FRAME_LOCALS_ADDRESS.
  (SCM_FRAME_UPPER_ADDRESS): Remove; unused.
  (SCM_FRAME_NUM_LOCALS, SCM_FRAME_PREVIOUS_SP): New defines.
  (SCM_FRAME_BYTE_CAST, SCM_FRAME_STACK_CAST): Remove; unused;
  (SCM_FRAME_LOCAL): New define, replaces SCM_FRAME_VARIABLE.
  (SCM_FRAME_PROGRAM): Add cautionary commentary.

* libguile/frames.c: Adapt static asserts.
  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
  Adapt.  This means that frame-local-ref 0 now returns the procedure.

* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME)
  (FRAME_LOCALS_COUNT, LOCAL_REF, LOCAL_SET, RETURN_VALUE_LIST): Adapt
  to change in fp.
  (LOCAL_ADDRESS): New helper.
  (POP_CONTINUATION_HOOK): Reimplement, taking the previous FP as an
  argument.
  (ABORT_CONTINUATION_HOOK): Reimplement, taking no arguments.
  (RETURN_ONE_VALUE): Reimplement.
  (RETURN_VALUE_LIST): Adapt to FP change.
  (halt, return-values, subr-call, foreign-call, prompt)
  (continuation-call, compose-continuation, call/cc, abort): Adapt to FP
  change, mostly via using LOCAL_ADDRESS, etc abstractions instead of
  using the raw frame pointer.

* libguile/control.c (reify_partial_continuation): Update for fp
  change.

* libguile/vm.c (vm_reinstate_partial_continuation): Adapt to removal of
  SCM_FRAME_UPPER_ADDRESS.

* module/system/vm/frame.scm (frame-call-representation): Adapt to
  frame-local-ref change.

* module/system/vm/trace.scm (print-return): Remove unused
  frame-num-locals call.

10 years agoAdd more entries to .gitignore
Mark H Weaver [Sun, 17 Nov 2013 05:35:26 +0000 (00:35 -0500)]
Add more entries to .gitignore

* .gitignore: Add /lib/poll.h, /lib/sys/select.h, /lib/sys/times.h,
  and /test-suite/standalone/test-scm-c-bind-keyword-arguments.

10 years agoRemove use of SCM_CRITICAL_SECTION in smob.c
Andy Wingo [Fri, 15 Nov 2013 16:14:15 +0000 (17:14 +0100)]
Remove use of SCM_CRITICAL_SECTION in smob.c

* libguile/smob.c (scm_make_smob_type): Use a mutex instead of a
  critical section, which does an async tick.  Not important, just a
  thing I saw.

10 years agoRemove MVRA from VM frames
Andy Wingo [Fri, 15 Nov 2013 16:13:10 +0000 (17:13 +0100)]
Remove MVRA from VM frames

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for frame layout
  change.

* libguile/frames.c: Update some static checks.
  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
  Update to not skip over uninitialized frames, as that's not a thing
  any more.

* libguile/frames.h: Update to remove MVRA.  Woo!

* libguile/vm-engine.c (ALLOC_FRAME, RETURN_ONE_VALUE):
  (rtl_vm_engine): Update for 3 words per frame instead of 4.

* libguile/vm.c (vm_return_to_continuation): Likewise.

* module/language/cps/slot-allocation.scm (allocate-slots): 3 words per
  frame, not 4.

* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.  Also
  remove a couple of tc7's that aren't around any more.

10 years agoRemove MVRA accessors in libguile
Andy Wingo [Fri, 15 Nov 2013 14:39:38 +0000 (15:39 +0100)]
Remove MVRA accessors in libguile

* libguile/vm.c (scm_i_vm_capture_stack): Remove MVRA argument, in
  preparation for removing MVRA from frames.
  (scm_i_capture_current_stack): Adapt to scm_i_vm_capture_stack
  change.
  (vm_reinstate_partial_continuation): Remove references to MVRA.

* libguile/vm.h (struct scm_vm_cont): Remove mvra member.

* libguile/vm-engine.c (call): Set MVRA to 0.  Will remove later.
  (return-values): Return to RA.
  (call/cc): Remove MVRA from capture call.

* libguile/frames.c:
* libguile/frames.h (SCM_FRAME_MV_RETURN_ADDRESS)
  (SCM_FRAME_RTL_MV_RETURN_ADDRESS, scm_frame_mv_return_address): Remove
  accessors.

* libguile/control.c (reify_partial_continuation): Adapt to
  scm_i_vm_capture_stack change.

10 years agoTry to allocate arguments directly in call frames
Andy Wingo [Fri, 15 Nov 2013 13:57:05 +0000 (14:57 +0100)]
Try to allocate arguments directly in call frames

* module/language/cps/slot-allocation.scm (allocate-slots): Convert
  cont-table to a vector, for ease of access.  Run a pass before
  allocation that determines the set of variables whose slot allocation
  can and should be delayed, so that they can ideally be allocated
  directly in an argument slot.

10 years agoRewrite slot allocation pass
Andy Wingo [Fri, 15 Nov 2013 10:17:18 +0000 (11:17 +0100)]
Rewrite slot allocation pass

* module/language/cps/slot-allocation.scm ($allocation): Refactor
  internal format of allocations.  Instead of an allocation being a hash
  table of small $allocation objects, it is an $allocation object that
  contains packed vectors.
  (find-first-trailing-zero): Rework to not need a maximum.
  (lookup-maybe-slot): New interface.
  (lookup-slot): Raise an error if a var has no slot.
  (lookup-call-allocation): New helper.
  (lookup-constant-value, lookup-maybe-constant-value):
  (lookup-call-proc-slot, lookup-parallel-moves): Adapt to $allocation
  change

  (allocate-slots): Rewrite so that instead of being recursive, it
  traverses the blocks in CFA order.  Also, procedure call frames are
  now allocated with respect to the live set after using arguments (and
  killing any dead-after-use vars); this should make call frames more
  compact but it does necessitate a parallel move solution.  Therefore
  parallel moves are recorded for all calls, for arguments; also if the
  continuation is a $ktrunc, the continuation gets parallel moves for
  the results.

  This rewrite is in preparation to allocating call args directly in the
  appropriate slots, where possible.

* module/language/cps/compile-rtl.scm (compile-fun): Adapt to slot
  allocation changes, using lookup-maybe-slot where appropriate,
  performing parallel moves when calling functions, and expecting return
  moves to be associated with $ktrunc continuations.

10 years agoReplace ($var sym) with ($values (sym)).
Andy Wingo [Wed, 13 Nov 2013 18:58:55 +0000 (19:58 +0100)]
Replace ($var sym) with ($values (sym)).

* module/language/cps.scm: Remove $var.  Replaced by $values with one
  value.

* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/dfg.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt all the world.

10 years agoi18n: Fix null pointer dereference when locale info is missing.
Ludovic Courtès [Wed, 13 Nov 2013 13:24:42 +0000 (14:24 +0100)]
i18n: Fix null pointer dereference when locale info is missing.

* libguile/i18n.c (scm_nl_langinfo): Check whether C_RESULT is NULL
  before calling 'strdup'.

10 years agoAdd specialize-primcalls pass; bump objcode version.
Andy Wingo [Sun, 10 Nov 2013 18:27:19 +0000 (19:27 +0100)]
Add specialize-primcalls pass; bump objcode version.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* libguile/objcodes.c (process_dynamic_segment): Expect the minor
  version to be present and, while we are still banging on the VM,
  exactly equal to SCM_OBJCODE_MINOR_VERSION.

* libguile/vm-engine.c: Renumber ops.  Remove the general make-vector.
  Rename constant-FOO to FOO/immediate.  Remove struct-ref and
  struct-set!, replace with struct-ref/immediate and
  struct-set!/immediate.

* module/Makefile.am:
* module/language/cps/specialize-primcalls.scm: New pass, inlines FOO to
  FOO/immediate -- e.g. vector-ref to vector-ref/immediate.

* module/language/cps/arities.scm: Remove struct-set! case, now that
  there is no struct-set! opcode.

* module/language/cps/compile-rtl.scm (compile-fun): Remove dispatch to
  constant-FOO versus FOO here -- that decision is made by
  specialize-primcalls.
  (optimize): Add specialize-primcalls pass.

* module/language/cps/dfg.scm (constant-needs-allocation?): Adapt to
  name changes.

* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
  (*primitive-constructors*): Add allocate-struct.

* module/system/vm/assembler.scm (*bytecode-major-version*):
  (*bytecode-minor-version*, link-dynamic-section): Write minor version
  into resulting image.

10 years agoEffects analysis distinguishes between struct fields
Andy Wingo [Sun, 10 Nov 2013 11:05:35 +0000 (12:05 +0100)]
Effects analysis distinguishes between struct fields

* module/language/tree-il/effects.scm (compile-time-cond):
  (define-effects): Make the effects analysis more precise,
  distinguishing between different kinds of mutable data.  On 64-bit
  systems we take advantage of the additional bits to be even more
  precise.
  (make-effects-analyzer): Inline handlers for all "accessor" primitives
  and their corresponding mutators.

* module/language/tree-il/peval.scm (peval): Reflow to remove use of the
  "accessor-primitive?" predicate.

* module/language/tree-il/primitives.scm (accessor-primitive?): Remove.

10 years agoEffects analysis sees match-error, throw-bad-structs as bailouts
Andy Wingo [Sun, 10 Nov 2013 09:13:37 +0000 (10:13 +0100)]
Effects analysis sees match-error, throw-bad-structs as bailouts

* module/language/tree-il/effects.scm (make-effects-analyzer): Allow
  module-ref calls to be treated as bailouts, if the procedure has the
  "definite-bailout?" property.  Perhaps this should be renamed.

* module/ice-9/match.upstream.scm (match-error):
* module/srfi/srfi-9.scm (throw-bad-struct): Give these procedures the
  definite-bailout? property.

10 years agoBinary search to find procedure properties.
Andy Wingo [Sat, 9 Nov 2013 15:25:12 +0000 (16:25 +0100)]
Binary search to find procedure properties.

* module/system/vm/debug.scm (find-program-properties): Use binary
  search.

10 years agoFix RTL linking of procedure properties.
Andy Wingo [Sat, 9 Nov 2013 15:23:35 +0000 (16:23 +0100)]
Fix RTL linking of procedure properties.

* module/system/vm/assembler.scm (link-procprops): Fix procedure
  property embedding in bytecode.

10 years agoBinary search to find docstrings.
Andy Wingo [Sat, 9 Nov 2013 15:15:12 +0000 (16:15 +0100)]
Binary search to find docstrings.

* module/system/vm/debug.scm (find-program-docstring): Use binary
  search.

10 years agoFinding a procedure's arity uses binary search
Andy Wingo [Sat, 9 Nov 2013 15:02:13 +0000 (16:02 +0100)]
Finding a procedure's arity uses 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.

10 years agoUse binary search in find-elf-symbol
Andy Wingo [Sat, 9 Nov 2013 14:51:54 +0000 (15:51 +0100)]
Use binary search in find-elf-symbol

* module/system/vm/debug.scm (binary-search): New helper.
  (find-elf-symbol): Use binary search.

10 years agoFix run-vm-tests
Andy Wingo [Fri, 8 Nov 2013 18:26:18 +0000 (19:26 +0100)]
Fix run-vm-tests

* test-suite/vm/run-vm-tests.scm: Fix for RTL.

10 years agoRemove stack programs, objcode, and the old VM.
Andy Wingo [Fri, 8 Nov 2013 17:28:24 +0000 (18:28 +0100)]
Remove stack programs, objcode, and the old VM.

* libguile/Makefile.am:
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Remove the old VM files, and the rules to
  build the .i files.

* libguile/vm-engine.c:
* libguile/vm.c: Remove the old VM.  Woot!

* libguile/_scm.h (SCM_OBJCODE_COOKIE, SCM_OBJCODE_ENDIANNESS_OFFSET)
  (SCM_OBJCODE_WORD_SIZE_OFFSET): Remove.

* libguile/evalext.c (scm_self_evaluating_p): Remove objcode and program
  cases.

* libguile/frames.c (scm_frame_num_locals, scm_frame_previous): Remove
  program cases.

* libguile/gc.c (scm_i_tag_name): Remove objcode case.
* libguile/goops.c (scm_class_of, create_standard_classes): Remove
  objcode and program cases.

* libguile/instructions.h:
* libguile/instructions.c (scm_instruction_list, scm_instruction_p)
  (scm_instruction_length, scm_instruction_pops, scm_instruction_pushes)
  (scm_instruction_to_opcode, scm_opcode_to_instruction): Remove old VM
  code.

* libguile/objcodes.h:
* libguile/objcodes.c: Remove the objcode data type, and handling for
  objcode files.

* libguile/print.c: Remove objcode and program printers.

* libguile/procprop.c: Remove program cases.
* libguile/procs.c:

* libguile/programs.h:
* libguile/programs.c: Remove old program code.

* libguile/smob.c: Remove objcodes include.

* libguile/snarf.h: Remove static program defines.

* libguile/stacks.c: Remove program case.

* libguile/tags.h: Remove program and objcode tc7s.

* module/ice-9/session.scm (procedure-arguments)
* module/language/tree-il/analyze.scm (validate-arity)
* module/statprof.scm (get-call-data, procedure=?)
* module/system/vm/frame.scm (frame-bindings)
  (frame-call-representation): Remove old program cases.

* module/system/repl/debug.scm (frame->module): Add a FIXME.

* module/system/vm/instruction.scm: Remove old exports.

* module/system/vm/program.scm: Remove old program code.

10 years agoMiscellaneous fixups related to objcode removal.
Andy Wingo [Fri, 8 Nov 2013 16:42:54 +0000 (17:42 +0100)]
Miscellaneous fixups related to objcode removal.

* module/scripts/compile.scm: Fix --help message.

* module/system/repl/command.scm (disassemble): Fix error message.

* module/system/vm/frame.scm: Remove objcode import.

* module/system/vm/objcode.scm: Remove some exports related to the
  objcode type.

10 years agoRemove program-sources-pre-retire case for stack programs.
Andy Wingo [Fri, 8 Nov 2013 16:41:31 +0000 (17:41 +0100)]
Remove program-sources-pre-retire case for stack programs.

* module/system/vm/program.scm (program-sources-pre-retire): Remove
  stack program case.

10 years agoRemove (language objcode)
Andy Wingo [Fri, 8 Nov 2013 16:40:46 +0000 (17:40 +0100)]
Remove (language objcode)

* module/language/objcode.scm: Remove.  Seems to have been unused.

10 years agoMove assemble-program to test cases.
Andy Wingo [Fri, 8 Nov 2013 16:36:45 +0000 (17:36 +0100)]
Move assemble-program to test cases.

* module/system/vm/assembler.scm (assemble-program): Remove.
* test-suite/tests/rtl.test (assemble-program): Move here.

10 years agoPer-instruction tracing doesn't try to disassemble stack VM code
Andy Wingo [Fri, 8 Nov 2013 16:32:41 +0000 (17:32 +0100)]
Per-instruction tracing doesn't try to disassemble stack VM code

* module/system/vm/trace.scm (trace-instructions-in-procedure): Don't
  try to disassemble the procedure, for now.

10 years ago(system vm traps) support for rtl programs
Andy Wingo [Fri, 8 Nov 2013 16:31:51 +0000 (17:31 +0100)]
(system vm traps) support for rtl programs

* 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.

10 years agoRemove objcode language.
Andy Wingo [Fri, 8 Nov 2013 15:51:44 +0000 (16:51 +0100)]
Remove objcode language.

* module/language/objcode/elf.scm:
* module/language/objcode/spec.scm: Remove objcode language.

* module/Makefile.am: Adapt.

10 years agoRemove bytecode language.
Andy Wingo [Fri, 8 Nov 2013 15:49:04 +0000 (16:49 +0100)]
Remove bytecode language.

* module/language/bytecode/spec.scm: Remove.

* module/Makefile.am: Adapt.

10 years agoRemove assembly language.
Andy Wingo [Fri, 8 Nov 2013 15:45:10 +0000 (16:45 +0100)]
Remove assembly language.

* module/system/repl/command.scm: Remove disassembly cases for stack
  procedures.

* module/system/vm/inspect.scm: Adapt to disassemble RTL programs.

* module/language/assembly.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/assembly/decompile-bytecode.scm:
* module/language/assembly/disassemble.scm:
* module/language/assembly/spec.scm: Remove assembly language.

* module/Makefile.am: Adapt.

10 years agoDecompile goes from tree-il to scheme by default.
Andy Wingo [Fri, 8 Nov 2013 15:40:27 +0000 (16:40 +0100)]
Decompile goes from tree-il to scheme by default.

* module/system/base/compile.scm (decompile): By default, go from
  tree-il to Scheme, now that the assembly language is going away.

10 years agoRewrite (system xref) to work with RTL programs
Andy Wingo [Fri, 8 Nov 2013 15:31:29 +0000 (16:31 +0100)]
Rewrite (system xref) to work with RTL programs

* 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.

10 years agoAdd fold-program-code to (system vm disassembler)
Andy Wingo [Fri, 8 Nov 2013 14:58:27 +0000 (15:58 +0100)]
Add fold-program-code to (system vm disassembler)

* module/system/vm/disassembler.scm (fold-code-range): New helper.
  (fold-program-code): New interface.

10 years agoRemove GLIL language
Andy Wingo [Fri, 8 Nov 2013 13:58:40 +0000 (14:58 +0100)]
Remove GLIL language

* module/Makefile.am:
* module/language/glil.scm:
* module/language/glil/compile-assembly.scm:
* module/language/glil/spec.scm: Remove.

10 years agoRemove tree-il->glil compiler
Andy Wingo [Fri, 8 Nov 2013 13:57:43 +0000 (14:57 +0100)]
Remove tree-il->glil compiler

* module/Makefile.am:
* module/language/tree-il/compile-glil.scm: Remove.

* module/language/tree-il/spec.scm: Remove tree-il->glil link.

10 years agoMove useful parts of asm-to-bytecode.test to cross-compilation.test
Andy Wingo [Fri, 8 Nov 2013 13:54:38 +0000 (14:54 +0100)]
Move useful parts of asm-to-bytecode.test to cross-compilation.test

* test-suite/tests/cross-compilation.test: Rename from asm-to-bytecode,
  and remove the bits testing assembly->bytecode but keep the
  cross-compilation things.

* test-suite/Makefile.am: Adapt.

10 years agoTree-IL warnings tests compile to CPS instead of "assembly"
Andy Wingo [Fri, 8 Nov 2013 13:45:01 +0000 (14:45 +0100)]
Tree-IL warnings tests compile to CPS instead of "assembly"

* test-suite/tests/tree-il.test ("warnings"): Change warnings test to
  compile to CPS instead of assembly.

10 years agoRemove tree-il->glil test cases
Andy Wingo [Fri, 8 Nov 2013 13:41:22 +0000 (14:41 +0100)]
Remove tree-il->glil test cases

* test-suite/tests/tree-il.test: Remove GLIL test cases.  They have
  never been helpful to me in the 2.0 series, so there is no loss.

10 years agoRemove a couple of uses of GLIL from the test suite.
Andy Wingo [Fri, 8 Nov 2013 13:27:13 +0000 (14:27 +0100)]
Remove a couple of uses of GLIL from the test suite.

* test-suite/tests/cse.test ("cse"):
* test-suite/tests/peval.test: Remove uses of GLIL.

10 years agoFix program-minimum-arity to work better with case-lambda.
Andy Wingo [Fri, 8 Nov 2013 13:19:41 +0000 (14:19 +0100)]
Fix program-minimum-arity to work better with case-lambda.

* module/system/vm/debug.scm (program-minimum-arity): Be more precise
  with case-lambdas.

10 years agoBuiltins have procedure properties
Andy Wingo [Fri, 8 Nov 2013 13:08:42 +0000 (14:08 +0100)]
Builtins have procedure properties

* libguile/vm-builtins.h (FOR_EACH_VM_BUILTIN): Add arity information.
  (enum scm_vm_builtins):
* libguile/vm.c (scm_vm_builtin_ref):
  (scm_vm_builtin_name_to_index):
  (scm_vm_builtin_index_to_name): Adapt to macro interface change.
  (scm_init_vm_builtin_properties): New helper, sets procedure
  properties on builtins.
  (scm_bootstrap_vm): Just define the builtins here.  Later in the
  bootstrap we set their properties.
  (scm_sym_apply): Move definition here from expand.c.

* libguile/procprop.c (scm_init_procprop): Call
  scm_init_vm_builtin_properties.

10 years agoFix procedure-arguments on RTL programs, and tweak session.test
Andy Wingo [Fri, 8 Nov 2013 12:29:03 +0000 (13:29 +0100)]
Fix procedure-arguments on RTL programs, and tweak session.test

* 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.

10 years agoFix make-vector peval test
Andy Wingo [Fri, 8 Nov 2013 12:25:08 +0000 (13:25 +0100)]
Fix make-vector peval test

* test-suite/tests/peval.test ("partial evaluation"): Fix to expect a
  primcall.

10 years agoFix case-lambda* dispatching to agree with manual.
Andy Wingo [Fri, 8 Nov 2013 10:41:28 +0000 (11:41 +0100)]
Fix case-lambda* dispatching to agree with manual.

* module/system/vm/assembler.scm (kw-prelude): Emit br-if-npos-gt as
  appropriate.

10 years agoAdd br-if-npos-gt
Andy Wingo [Fri, 8 Nov 2013 10:38:34 +0000 (11:38 +0100)]
Add br-if-npos-gt

* libguile/vm-engine.c (br-if-npos-gt): New instruction (sigh!).  For
  case-lambda* dispatching on the number of positional args, as the
  manual describes.  Renumber other opcodes.

10 years agoFix BR_NARGS data type width
Andy Wingo [Fri, 8 Nov 2013 10:36:53 +0000 (11:36 +0100)]
Fix BR_NARGS data type width

* libguile/vm-engine.c (BR_NARGS): Fix width of "expected".  Fixes bug
  with > 65536 arguments in case-lambda clauses.

10 years agoFix arity selection in compute-contification
Andy Wingo [Fri, 8 Nov 2013 09:59:52 +0000 (10:59 +0100)]
Fix arity selection in compute-contification

* module/language/cps/contification.scm (compute-contification): Fail as
  soon as we see an arity with rest, optional, or keyword arguments.
  Fixes ((case-lambda ((a . b) #t) ((a b) #f)) 1 2).

10 years agoFix error message in lambda* eval closures with keywords
Andy Wingo [Fri, 8 Nov 2013 09:37:09 +0000 (10:37 +0100)]
Fix error message in lambda* eval closures with keywords

* module/ice-9/eval.scm (primitive-eval): For ((lambda* (#:key foo) foo) 'bar),
  give an "invalid keyword" error instead of a "wrong number of
  arguments" error.

10 years agoFix reading and writing arities into DWARF.
Andy Wingo [Fri, 8 Nov 2013 09:03:48 +0000 (10:03 +0100)]
Fix reading and writing arities into DWARF.

* 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.

10 years agoFix eval.test: stack involving a primitive
Andy Wingo [Fri, 8 Nov 2013 08:07:32 +0000 (09:07 +0100)]
Fix eval.test: stack involving a primitive

* test-suite/tests/eval.test ("stacks"): Revert expect-fail introduced
  in 27337b6373954e1a975d97d0bf06b5c03d65b64d.

10 years agoFix coverage.test: instrumented-source-files
Andy Wingo [Fri, 8 Nov 2013 08:02:30 +0000 (09:02 +0100)]
Fix coverage.test: instrumented-source-files

* test-suite/tests/coverage.test ("instrumented-source-files"): Adapt to
  new expectation that all files loaded on the system will be present in
  the source information.

10 years agoFix coverage.test: "procedure-execution-count: never"
Andy Wingo [Fri, 8 Nov 2013 08:00:06 +0000 (09:00 +0100)]
Fix coverage.test: "procedure-execution-count: never"

* test-suite/tests/coverage.test ("procedure-execution-count"): Adapt
  test to new behavior of procedure-execution-count of an unseen
  procedure: zero, not false.

10 years agoFix coverage.test: "line-execution-counts: one proc hit, one proc unused"
Andy Wingo [Fri, 8 Nov 2013 07:56:52 +0000 (08:56 +0100)]
Fix coverage.test: "line-execution-counts: one proc hit, one proc unused"

* test-suite/tests/coverage.test ("line-execution-counts"): Fix test for
  even/odd? in letrec.  The test profiles the execution of even?, not
  the letrec, so the last line is in fact not reached.

10 years agoframe-instruction-pointer is absolute; rewrite (system vm coverage)
Andy Wingo [Thu, 7 Nov 2013 22:03:45 +0000 (23:03 +0100)]
frame-instruction-pointer is absolute; rewrite (system vm coverage)

* 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.

10 years agoscm_from_uintptr_t / scm_from_ptrdiff_t usage
Andy Wingo [Thu, 7 Nov 2013 17:11:00 +0000 (18:11 +0100)]
scm_from_uintptr_t / scm_from_ptrdiff_t usage

* libguile/frames.c:
* libguile/programs.c: Use scm_from_ptrdiff_t and scm_from_uintptr_t
  where appropriate.

10 years agoProgram sources are always pre-retire now
Andy Wingo [Thu, 7 Nov 2013 17:00:40 +0000 (18:00 +0100)]
Program sources are always pre-retire now

* module/system/repl/debug.scm (<debug>): Remove for-trap?.  Backtraces
  with RTL will always happen pre-retire on the top frame, source info
  is pre-retire, and continuations will always have a source-marked
  receive or receive-values or whatever with the right source marking,
  so we can remove this complication.
  (print-frame): Use frame-source.
  (print-frames): Remove for-trap? kw.

* module/system/repl/command.scm (define-stack-command, backtrace)
  (up, down, frame): Remove for-trap? introduced local, and its uses.
  (repl-pop-continuation-resumer): Adapt to make-debug change.

* module/system/repl/error-handling.scm (call-with-error-handling):
  Adapt to make-debug change.

* module/system/vm/frame.scm (frame-next-source): Remove.  RTL sources
  are pre-retire.

* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Adapt
  to use frame-source.  Still some work to do here.

10 years agoadd fold-all-debug-contexts, fold-source-locations
Andy Wingo [Thu, 7 Nov 2013 16:53:04 +0000 (17:53 +0100)]
add fold-all-debug-contexts, fold-source-locations

* 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.

10 years agoFix DWARF source test now that we have more precise source info.
Andy Wingo [Thu, 7 Nov 2013 10:16:24 +0000 (11:16 +0100)]
Fix DWARF source test now that we have more precise source info.

* test-suite/tests/dwarf.test: Fix test after the $continue/$cont source
  change, which reifies proper source info for the +.

10 years agoFix line advance DWARF opcodes when line advance is exactly 128
Andy Wingo [Thu, 7 Nov 2013 10:10:36 +0000 (11:10 +0100)]
Fix line advance DWARF opcodes when line advance is exactly 128

* module/system/vm/assembler.scm (link-debug): Fix off-by-one error in
  which forward jumps of 128 were mis-rendered.

10 years agoWrite DWARF files list in correct order.
Andy Wingo [Thu, 7 Nov 2013 09:52:47 +0000 (10:52 +0100)]
Write DWARF files list in correct order.

* module/system/vm/assembler.scm (link-debug): Fix order of writing the
  source files list; it was being written backwards.

10 years agoSource information goes on the $continue, not the $cont.
Andy Wingo [Thu, 7 Nov 2013 09:32:21 +0000 (10:32 +0100)]
Source information goes on the $continue, not the $cont.

* module/language/cps.scm ($continue, $cont): Put source information on
  the $continue, not on the $cont.  Otherwise it is difficult for CPS
  conversion to preserve source information.
  ($fun): Add a src member to $fun.  Otherwise we might miss the source
  info for the start of the function.

* .dir-locals.el:
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/dfg.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Update the whole CPS world
  for this change.

10 years agoFix first find-program-sources result
Andy Wingo [Wed, 6 Nov 2013 16:33:43 +0000 (17:33 +0100)]
Fix first find-program-sources result

* module/system/vm/debug.scm (find-program-sources): Manually set the pc
  of the first result in a function.

10 years agocompiler.test fix for rtl compilation
Andy Wingo [Tue, 5 Nov 2013 20:33:00 +0000 (21:33 +0100)]
compiler.test fix for rtl compilation

* test-suite/tests/compiler.test ("current-reader"): Fix the way we make
  programs from objcode.

10 years agofix docstring assembly and fetching
Andy Wingo [Tue, 5 Nov 2013 20:29:46 +0000 (21:29 +0100)]
fix docstring assembly and fetching

* 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!

10 years agoasm-labels is a hash table
Andy Wingo [Tue, 5 Nov 2013 19:18:23 +0000 (20:18 +0100)]
asm-labels is a hash table

* module/system/vm/assembler.scm (make-assembler, label):
  (link-data, process-relocs, process-labels): Change labels to be a
  hash table.

10 years agofix make-long-immediate, make-long-long-immediate for dst >= 256
Andy Wingo [Tue, 5 Nov 2013 18:22:26 +0000 (19:22 +0100)]
fix make-long-immediate, make-long-long-immediate for dst >= 256

* libguile/vm-engine.c (make-long-immediate, make-long-long-immediate):
  Fix declaration of "dst" variable.

10 years agoRe-add the list hack to compile-cps
Andy Wingo [Tue, 5 Nov 2013 17:16:13 +0000 (18:16 +0100)]
Re-add the list hack to compile-cps

* module/language/tree-il/compile-cps.scm (convert): Re-add the list
  hack.  Ideally these go into some tree-il pass.

10 years agosquish to primitive reification
Andy Wingo [Tue, 5 Nov 2013 17:06:08 +0000 (18:06 +0100)]
squish to primitive reification

* test-suite/tests/tree-il.test: Update for primitive-ref reification
  fix.

10 years agoDon't use the identifier 'noreturn'.
Mark H Weaver [Tue, 5 Nov 2013 00:41:52 +0000 (19:41 -0500)]
Don't use the identifier 'noreturn'.

Fixes <http://bugs.gnu.org/15798>.
Reported by Matt Sicker <boards@gmail.com>.

* libguile/__scm.h (SCM_NORETURN): Use ((__noreturn__)) instead of
  ((noreturn)).

* libguile/throw.h (scm_ithrow): Rename formal parameter from 'noreturn'
  to 'no_return'.

* libguile/throw.c (scm_ithrow): Rename formal parameter from 'noreturn'
  to 'no_return'.

10 years agoFix test case for uniform-array->bytevector on bitvectors
Andy Wingo [Sun, 3 Nov 2013 21:00:18 +0000 (22:00 +0100)]
Fix test case for uniform-array->bytevector on bitvectors

* test-suite/tests/bytevectors.test ("uniform-array->bytevector"):
  Bitvectors are accessed in 32-bit chunks.

10 years agoRTL compiler supports static bitvectors
Andy Wingo [Sun, 3 Nov 2013 20:45:34 +0000 (21:45 +0100)]
RTL compiler supports static bitvectors

* libguile/arrays.c (scm_from_contiguous_typed_array):
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): For
  bitvectors, round up the length to 32-bit units, as they are stored
  internally.  Otherwise I think this probably does the wrong thing for
  the last word on big-endian systems.
* libguile/bitvectors.c (BITVECTOR_LENGTH, BITVECTOR_BITS):
  (scm_c_make_bitvector): Reorder the length and pointer words to match
  the layout of bytevectors.

* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/system/vm/assembler.scm (br-if-bitvector):
* module/system/vm/disassembler.scm (code-annotation): Add bitvector
  test support.

* module/system/vm/assembler.scm (<uniform-vector-backing-store>): Add
  an element-size field.
  (intern-constant): Adapt make-uniform-vector-backing-store call.  Use
  uniform-array->bytevector, as the old compiler did.
  (link-data): Add bitvector cases.

10 years agostruct-set! returns a value, yuck
Andy Wingo [Sun, 3 Nov 2013 19:24:54 +0000 (20:24 +0100)]
struct-set! returns a value, yuck

* module/language/cps/arities.scm (fix-clause-arities): Add a hack to
  ensure that (struct-set! OBJ POS VAL) evaluates to VAL.  Yuck.

10 years agoCorrectness fix for vector constructor inlining.
Andy Wingo [Sun, 3 Nov 2013 11:28:47 +0000 (12:28 +0100)]
Correctness fix for vector constructor inlining.

* module/language/tree-il/compile-cps.scm (convert): Don't inline the
  vector constructor if any arg could capture the current continuation.

10 years agoEval evaluates initializers before creating environment ribs.
Andy Wingo [Sun, 3 Nov 2013 11:16:49 +0000 (12:16 +0100)]
Eval evaluates initializers before creating environment ribs.

* module/ice-9/eval.scm (let-env-evaluator, primitive-eval): Evaluate
  initializers of let expressions before creating the environment rib.
  This prevents call/cc-related shenanigans.

10 years ago"length" is an interesting primitive
Andy Wingo [Sun, 3 Nov 2013 11:15:09 +0000 (12:15 +0100)]
"length" is an interesting primitive

* module/language/tree-il/primitives.scm (*effect-free-primitives*):
  (*interesting-primitive-names*): Add "length", so that we can
  constant-fold it.

10 years agoRevert "Compile-time debugging"
Andy Wingo [Fri, 1 Nov 2013 18:43:45 +0000 (19:43 +0100)]
Revert "Compile-time debugging"

This reverts commit 6a37b7faaf150e9fb7945ef79969cb7671d17367.

10 years agoFix call/cc with the RTL VM
Andy Wingo [Fri, 1 Nov 2013 18:28:36 +0000 (19:28 +0100)]
Fix call/cc with the RTL VM

* libguile/vm.c (vm_return_to_continuation): The RTL VM saves the
  registers for the caller of call/cc, but the caller will expect values
  in the normal MV return location: above the frame.  Make it so, number
  four!

10 years agoFix order of evaluation in elisp lexer
Andy Wingo [Fri, 1 Nov 2013 17:23:51 +0000 (18:23 +0100)]
Fix order of evaluation in elisp lexer

* module/language/elisp/lexer.scm (lex): Use let*, to ensure that the
  port position is read before reading the next char.

10 years agoFix contification of non-recursive closures
Andy Wingo [Fri, 1 Nov 2013 17:22:58 +0000 (18:22 +0100)]
Fix contification of non-recursive closures

* module/language/cps/contification.scm (compute-contification): When
  eliding let-bound functions, also record the cont that declares the
  function.
  (apply-contification): Instead of reifying ($values ()) gotos instead
  of the elided function, inline the body that binds the function
  directly.  This ensures that the function gets contified in its own
  scope.

10 years agoRTL compilation sorts continuations topologically before visiting them
Andy Wingo [Fri, 1 Nov 2013 13:37:57 +0000 (14:37 +0100)]
RTL compilation sorts continuations topologically before visiting them

* module/language/cps/compile-rtl.scm (compile-fun): Rewrite to visit
  conts in reverse-post-order, which is a topological sort on the basic
  blocks.

* module/language/cps/slot-allocation.scm (allocate-slots): Expect a DFG
  as an argument.

10 years agoFailed match errors generate less code
Andy Wingo [Fri, 1 Nov 2013 12:37:27 +0000 (13:37 +0100)]
Failed match errors generate less code

* module/ice-9/match.upstream.scm (match-next): Call out to an external
  procedure on error, and use a begin instead of double-parens.  This
  results in less generated code.

10 years agoAdd compile-cps hack for vectors
Andy Wingo [Fri, 1 Nov 2013 07:51:52 +0000 (08:51 +0100)]
Add compile-cps hack for vectors

* module/language/tree-il/compile-cps.scm (convert): Add a special case
  for "vector" primcalls.  Boo!

10 years agoBetter range checks in the assembler
Andy Wingo [Thu, 31 Oct 2013 21:57:06 +0000 (22:57 +0100)]
Better range checks in the assembler

* module/system/vm/assembler.scm (pack-u8-u24, pack-u8-s24):
  (pack-u1-u7-u24, pack-u8-u12-u12, pack-u8-u8-u16, pack-u8-u8-u8-u8):
  Prevent adjacent fields from stompling each other.

10 years agoBe smarter about capturing the environment for memoized code
Andy Wingo [Thu, 31 Oct 2013 21:16:10 +0000 (22:16 +0100)]
Be smarter about capturing the environment for memoized code

* libguile/memoize.h (SCM_M_CAPTURE_MODULE)
* libguile/memoize.c (MAKMEMO_CAPTURE_MODULE, capture_env):
  (maybe_makmemo_capture_module, memoize): Determine when to capture the
  module on the environment chain at compile-time, instead of at
  runtime.  Introduces a new memoized expression type, capture-module.
  (scm_memoized_expression): Start memoizing with #f as the
  environment.
  (unmemoize): Add unmemoizer.
  (scm_memoize_variable_access_x): Cope with #f as module, and treat as
  the root module (captured before modules were booted).

* libguile/eval.c (eval):
* module/ice-9/eval.scm (primitive-eval): Adapt.

10 years agodefine! is an interesting primitive
Andy Wingo [Thu, 31 Oct 2013 19:39:22 +0000 (20:39 +0100)]
define! is an interesting primitive

* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
  Add define!.

10 years agofix compilation of (let lp () (lp))
Andy Wingo [Thu, 31 Oct 2013 19:24:38 +0000 (20:24 +0100)]
fix compilation of (let lp () (lp))

* module/language/cps/dfg.scm (reverse-post-order): Add an optional
  "fold-all-conts" argument.
  (compute-live-variables): Take the function as an arg instead of the
  start continuation, and implement fold-all-conts so that nodes that
  never reach the tail also get liveness information.

10 years agoDFG: Export analyze-control-flow.
Andy Wingo [Thu, 31 Oct 2013 18:24:42 +0000 (19:24 +0100)]
DFG: Export analyze-control-flow.

* module/language/cps/dfg.scm ($cfa, $dominator-analysis): Remove
  dominator things from $cfa, to break out to separate structure.
  (cfa-k-idx, cfa-k-count, cfa-k-sym, cfa-predecessors): New public
  accessors.
  (analyze-control-flow): New public function.
  (analyze-dominators): Adapt.

10 years agostatic-patch! for pair and vector fields
Andy Wingo [Thu, 31 Oct 2013 18:21:31 +0000 (19:21 +0100)]
static-patch! for pair and vector fields

* module/system/vm/assembler.scm (intern-constant): Use static-patch!
  for fields.

10 years agoBetter REPL support for disassembling RTL images
Andy Wingo [Thu, 31 Oct 2013 13:18:25 +0000 (14:18 +0100)]
Better REPL support for disassembling RTL images

* module/system/repl/command.scm (load-image): New helper.
  (compile, disassemble): Handle bytevectors.

10 years agoDefault to compiling to RTL
Andy Wingo [Thu, 31 Oct 2013 13:17:30 +0000 (14:17 +0100)]
Default to compiling to RTL

* module/ice-9/eval-string.scm (eval-string)
* module/language/tree-il/spec.scm (tree-il)
* module/scripts/compile.scm (compile)
* module/system/base/compile.scm (compile-file, read-and-compile)
* module/system/repl/common.scm (repl-compile, repl-prepare-eval-thunk):
  Default to compiling to RTL.

* module/language/rtl/spec.scm (rtl->value): Add value compiler.

10 years agoAvoid calling procedure-name when doing a make-procedure-with-setter
Andy Wingo [Thu, 31 Oct 2013 11:52:23 +0000 (12:52 +0100)]
Avoid calling procedure-name when doing a make-procedure-with-setter

* libguile/procs.c (scm_make_procedure_with_setter): Don't set the name
  of the procedure.  Instead rely on procedure-name to look it up from
  the wrapped procedure as needed.
* libguile/procprop.c (scm_procedure_name): If there was no override and
  the procedure is a procedure-with-setter, recurse on the procedure.

10 years agoBetter aliased primcall compilation
Andy Wingo [Thu, 31 Oct 2013 11:06:06 +0000 (12:06 +0100)]
Better aliased primcall compilation

* libguile/vm-engine.c (define!): Rename from define.
* module/language/cps/arities.scm (fix-clause-arities): If a prim
  aliases an RTL instruction with a different name and we reify a
  primcall, reify the instruction name.
* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Update
  emit-define! for new name.
* module/language/cps/primitives.scm (*rtl-instruction-aliases*): Add
  bytevector native accessors.

10 years agoBetter compiler support for bytevector ops
Andy Wingo [Thu, 31 Oct 2013 10:39:43 +0000 (11:39 +0100)]
Better compiler support for bytevector ops

* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add emitters
  for bytevector ops.  Add br-if-bytevector emitter.
* module/language/cps/primitives.scm (*branching-primcall-arities*):
  Mark bytevector? as a branching primitive.
* module/system/vm/assembler.scm (br-if-bytevector): New instruction
* module/system/vm/disassembler.scm (code-annotation): Add support for
  bytevector?.

10 years agoFix bytevector error messages.
Andy Wingo [Thu, 31 Oct 2013 10:30:53 +0000 (11:30 +0100)]
Fix bytevector error messages.

* libguile/vm-engine.c (BV_FIXABLE_INT_SET, BV_INT_SET):
  (BV_FLOAT_SET): Fix instruction names in error messages.

10 years agoSupport serialization of uniform vector literals
Andy Wingo [Wed, 30 Oct 2013 20:11:03 +0000 (21:11 +0100)]
Support serialization of uniform vector literals

* libguile/uniform.h:
* libguile/uniform.c (scm_uniform_vector_element_type_code): New
  interface, returns a type code as an integer.

* module/system/vm/assembler.scm (<uniform-vector-backing-store>)
  (simple-vector?, uniform-array?, statically-allocatable?)
  (intern-constant, link-data, link-constants): Support uniform arrays,
  and punt on vectors aren't contiguous from 0.  Support for general
  arrays will come later.

* test-suite/tests/rtl.test ("load-constant"): Add tests.

10 years agoCompile-time debugging
Andy Wingo [Sun, 27 Oct 2013 19:10:59 +0000 (20:10 +0100)]
Compile-time debugging

* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm: Add some compile-time
  printouts.  Will be removed later.

10 years agoDFG: $block no longer stores control-flow analysis
Andy Wingo [Thu, 31 Oct 2013 09:49:38 +0000 (10:49 +0100)]
DFG: $block no longer stores control-flow analysis

* module/language/cps/dfg.scm ($block): Remove dominator-related things
  from $block.
  (reverse-post-order, convert-predecessors): Be more abstract, taking
  arbitrary identifiers for nodes instead of assuming the nodes are
  continuation names.
  (make-block-mapping): New helper.
  ($cfa): New data type, for dominator and loop analysis.  Not yet
  public.
  (analyze-control-flow): Rewrite to only compute the dominator tree in
  one direction, but take that direction as an argument.  To be public
  once there is some code that uses it.
  ($dfa): Refactor function fields to be hash tables.
  (dfa-k-idx, dfa-var-idx): Adapt to refactor.
  (compute-live-variables): Adapt to refactor.

10 years agostatic-patch! replaces link-procedure!
Andy Wingo [Thu, 31 Oct 2013 08:44:59 +0000 (09:44 +0100)]
static-patch! replaces link-procedure!

* libguile/vm-engine.c (static-patch!): Replace link-procedure! with
  this more versatile primitive.
* module/system/vm/assembler.scm (intern-constant): Emit static-patch!
  for static procedures and for strings.
* module/system/vm/disassembler.scm (code-annotation): Remove annotation
  for link-procedure!.  There can be no annotation for static-patch!, as
  neither operand is guaranteed to be a SCM value.

10 years agoFix primitive reification for class-of, bytevector-u8-ref, etc
Andy Wingo [Wed, 30 Oct 2013 20:08:38 +0000 (21:08 +0100)]
Fix primitive reification for class-of, bytevector-u8-ref, etc

* module/language/cps/reify-primitives.scm (primitive-module): Not all
  primitives are bound in (guile).

10 years agoDFG: Disable control-flow analysis.
Andy Wingo [Tue, 29 Oct 2013 22:06:07 +0000 (23:06 +0100)]
DFG: Disable control-flow analysis.

* module/language/cps/dfg.scm (visit-fun): Disable control-flow analysis
  for now, as it is not used.

10 years agoAdd "pop" field to $prompt
Andy Wingo [Tue, 29 Oct 2013 21:57:29 +0000 (22:57 +0100)]
Add "pop" field to $prompt

* module/language/cps.scm ($prompt): Add a "pop" field, indicating the
  continuation at which this prompt is popped.  The body of the prompt
  is dominated by the prompt, and post-dominated by the pop.  Adapt all
  builders and users.

* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt.

* module/language/cps/dfg.scm (visit-fun): Add an arc from the pop to
  the handler, to keep handler variables alive through the prompt body.

10 years agoDWARF return arity fixen
Andy Wingo [Sun, 27 Oct 2013 19:59:50 +0000 (20:59 +0100)]
DWARF return arity fixen

* module/system/vm/dwarf.scm (read-die-abbrev): Fix return arity.
  (read-compilation-unit): Fix return arity of read-die.