[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, wip-case-lambda, created. release_1-9-

From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, wip-case-lambda, created. release_1-9-3-75-g5ed1cbd
Date: Mon, 12 Oct 2009 20:13:01 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, wip-case-lambda has been created
        at  5ed1cbdc992402f2ba93415e908e426839912185 (commit)

- Log -----------------------------------------------------------------
commit 5ed1cbdc992402f2ba93415e908e426839912185
Author: Andy Wingo <address@hidden>
Date:   Mon Oct 12 22:13:06 2009 +0200

    tree-il support for case-lambda
    * module/language/tree-il.scm (<lambda>, <lambda-case>): Split lambda
      into the lambda itself, denoting the procedure, and lambda-case,
      denoting a particular arity case. Lambda-case is fairly featureful,
      and has not yet been fully tested.
      (<let-values>): Use a <lambda-case> as the binding expression. Seems
      to suit the purpose well.
      Adapt parsers, unparsers, traversal operators, etc. Sometimes in this
      first version we assume there are no optional args, rest args, or a
    * module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for the
      new case-lambda regime. Fairly well commented. It actually simplifies
    * module/language/tree-il/compile-glil.scm: Adapt for the new tree-il.
      There are some first stabs here at proper case-lambda compilation, but
      they are untested as of yet.
    * module/language/tree-il/inline.scm (inline!): Rework so we can
      recurse on a single node; though these transformations are strictly
      reductive, so they should complete in bounded time. Simplify
      accordingly, and adapt to case-lambda. Oh, and we handle lambda->let
      in not just the nullary case.
    * module/ice-9/psyntax.scm (build-simple-lambda, build-case-lambda)
      (build-lambda-case): New constructors. The idea is that after syntax
      expansion, we shouldn't have to deal with improper lists any more.
      Build-simple-lambda is a shortcut for the common case. The others are
      not fully exercised yet. Adapt callers.
      (syntax): Add some debugging in the lambda case. I don't fully
      understand this, but in practice we don't seem to see rest args here.
      (lambda): Inline chi-lambda-clause, and adapt for build-simple-lambda.
    * module/ice-9/psyntax-pp.scm: Regenerated.

commit eb6cf9e6f4909fda83fb00ea7d4151eb44c505bd
Author: Andy Wingo <address@hidden>
Date:   Mon Oct 12 22:01:21 2009 +0200

    program arity fixes
    * libguile/procprop.c (scm_procedure_property)
      scm_set_procedure_property_x): Fix to not call
      scm_procedure_properties(), and thus to avoid consing up the arity as
    * libguile/programs.c (scm_i_program_arity): Opt may be #f, in which
      case return 0 for the number of optional arguments.

commit b7741df5a9dda80a6d93320f9fb64019736b2b59
Author: Andy Wingo <address@hidden>
Date:   Sat Oct 10 17:38:15 2009 +0200

    flesh out glil support for optional and keyword arguments
    * libguile/vm-i-system.c (bind-rest): Renamed from push-rest-list.
      (reserve-locals): Change so that instead of reserving space for some
      additional number of locals, reserve-locals takes the absolute number
      of locals, including the arguments.
    * module/language/glil.scm (<glil-std-prelude>, <glil-opt-prelude>)
      (<glil-kw-prelude>): New GLIL constructs, to replace <glil-arity>.
    * module/language/glil/compile-assembly.scm (glil->assembly): Compile
      the new preludes. Some instructions are not yet implemented, though.
    * module/language/tree-il/analyze.scm (analyze-lexicals): The nlocs for
      a lambda will now be the total number of locals, including arguments.
    * module/language/tree-il/compile-glil.scm (flatten-lambda): Update to
      write the new prelude.
    * module/system/vm/program.scm (program-bindings-for-ip): If a given
      index doesn't have a binding at the ip given, don't cons it on the
      resulting list.

commit d03c4515643033a582b510db789a8e3c6bd90efb
Author: Andy Wingo <address@hidden>
Date:   Fri Oct 9 13:03:19 2009 +0200

    de-nargs struct scm_objcode; remove GHIL; procedure-property refactor
    * 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
    * 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/
    * module/language/ghil.scm:
    * module/language/ghil/compile-glil.scm:
    * module/language/ghil/spec.scm:
    * module/language/scheme/compile-ghil.scm: Remove GHIL. About time!
    * 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
    * module/language/glil.scm: Remove nargs, nrest, and nlocs from
    * 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.

commit 9e7aac002050b623715400b5aa7f87bd8756a634
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 27 20:25:39 2009 -0400

    callees now check their args, cons rest list, reserve locals
    * gdbinit: Ignore SIGPWR and SIGXCPU, which the BDW GC seems to use.
    * libguile/vm-engine.h (FETCH_WIDTH): Remove unused macro.
      (INIT_ARGS, INIT_FRAME): Remove; callees now check their args and
      reserve space for their locals.
    * libguile/vm-engine.c:
    * libguile/vm-i-system.c: Turn on callee arg checking and local
      reservation. Seems to work!

commit 499053f428c0aa612c54ef1bc786917d178626d9
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 27 19:50:06 2009 -0400

    callees reserve their own local vars
    * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
    * libguile/vm-i-system.c (reserve-locals): New instruction, to reserve
      space for local vars. Other ops renumbered.
    * module/language/tree-il/compile-glil.scm (flatten-lambda): Emit
      reserve-locals instructions as necessary.

commit 86d08795dc7c93a51bde75af20793e13174ad7c0
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 27 19:25:58 2009 -0400

    runtime and debugging support for callee-parsed procedure args
    * libguile/frames.h: Rework so we don't frob the program's nargs, nlocs,
      etc at runtime. Instead we don't really know what's a local var, an
      argument, or an intermediate value. It's a little unfortunate, but
      this will allow for case-lambda, and eventually for good polymorphic
      generic dispatch; and the nlocs etc can be heuristically
      reconstructed. Such a reconstruction would be better done at the
      Scheme level, though.
      (SCM_FRAME_STACK_ADDRESS): New macro, the pointer to the base of the
      stack elements (not counting the program).
      (SCM_FRAME_UPPER_ADDRESS): Repurpose to be the address of the last
      element in the bookkeeping part of the stack -- i.e. to point to the
      return address.
    * libguile/vm-engine.h:
    * libguile/vm-i-system.c: Adapt to removal of stack_base. Though we
      still detect stack-smashing underflow, we don't do so as precisely as
      we did before, because now we only detect overwriting of the frame
    * libguile/vm-engine.c (vm_engine): Remove the stack_base variable. It
      is unnecessary, and difficult to keep track of in the face of
      case-lambda. Also fix miscommented "ra" and "mvra" pushes. Push the
      vp->ip as the first ra...
    * libguile/vm-i-system.c (halt): ...because here we can restore the
      vp->ip instead of setting ip to 0. Allows us to introspect ips all
      down the stack, including in recursive VM invocations.
    * libguile/frames.h:
    * libguile/frames.c (scm_vm_frame_stack): Removed, because it's getting
      more difficult to tell what's an argument and what's a temporary stack
      (scm_vm_frame_num_locals): New accessor.
      (scm_vm_frame_instruction_pointer): New accessor.
      (scm_vm_frame_arguments): Defer to an implementation in Scheme.
      (scm_vm_frame_num_locals scm_vm_frame_local_ref)
      (scm_vm_frame_local_set_x): Since we can get not-yet-active frames on
      the stack now, with our current calling convention, we have to add a
      heuristic here to jump over those frames -- because frames have
      pointers in them, not Scheme values.
    * libguile/programs.h:
    * libguile/programs.c (scm_program_arity): Remove. Arity metadata will
      now be part of the program-metadata.
    * module/language/assembly/decompile-bytecode.scm (decode-load-program):
      Fix mv-call decompilation.
    * module/system/vm/frame.scm (vm-frame-bindings, vm-frame-binding-ref)
      (vm-frame-binding-set!): New functions, to access bindings by name in
      a frame.
      (vm-frame-arguments): Function now implemented in Scheme. Commented
      fairly extensively.
    * module/system/vm/program.scm (program-bindings-by-index)
      (program-bindings-for-ip): New accessors, parsing the program bindings
      metadata into something more useful.
      (program-arglists, program-arguments): In a case-lambda world, we have
      to assume that programs can have multiple arities. But it's tough to
      detect this algorithmically; instead we're going to require that the
      program metadata include information about the arities, and the parts
      of the program that that metadata applies to.
      (program-lambda-list): New accessor.
      (write-program): Show multiple arities.
    * module/language/tree-il/compile-glil.scm (flatten-lambda): Some very
      ghetto arglist serializing. Needs help, but at least we get arities
      for procedures.

commit 4b3974be53dd0c8b58f610da1ebfbbe0b6819435
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 27 18:16:56 2009 -0400

    steps on the way to have the callee check the number of arguments
    * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
    * libguile/vm-i-system.c (assert-nargs-ee, assert-nargs-ge)
      (push-rest-list): New instructions, which for now don't actually do
      anything. Renumber the rest of the ops in this file.
    * module/language/glil.scm (<glil-arity>): New GLIL type, an entity that
      checks the number of args for a block, optionally consing a rest list,
      and either branching or erroring if the arity doesn't match.
    * module/language/glil/compile-assembly.scm (glil->assembly): Compile
      <glil-arity> to assembly. Some of these VM ops are not implemented --
      notably the branching case.
    * module/language/tree-il/compile-glil.scm (flatten-lambda): Emit

commit b61bcc7ba47b8a55b95955dca7e05ffff88156c2
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 27 15:57:06 2009 -0400

    comment fixups to tree-il/compile-glil.scm
    * module/language/tree-il/compile-glil.scm: Remove some outdated

commit 6b56cd7f13a076c0621209d61d53a9c1e212e6a8
Author: Andy Wingo <address@hidden>
Date:   Thu Sep 17 14:58:31 2009 +0200

    jumps encoded using 24 bits, not 19; blocks no longer aligned
    * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
    * libguile/vm-i-system.c (FETCH_OFFSET, BR): Labels are no longer 8-byte
      aligned; instead, jumps are encoded into 3 bytes instead of 2.
      (br, br-if, br-if-not, br-if-eq, br-if-not-eq, br-if-null)
      (br-if-not-null, mv-call): Adapt for new length of br instructions (3
      bytes instead of 2).
    * libguile/vm.c (really_make_boot_program): Adapt hand-coded bytecode
      for new offset regime.
    * module/language/assembly.scm (align-block): No alignment necessary.
    * module/language/assembly/compile-bytecode.scm (write-bytecode): Write
      out breaks as 24-bit relative jumps.
    * module/language/assembly/decompile-bytecode.scm (decode-load-program):
      Decompile break instructions.


GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]