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

14 commits

Author SHA1 Message Date
Andy Wingo
d7bbf6d5db Add letrectify tree-il pass
* module/language/tree-il/letrectify.scm: New pass, not wired up yet.
  Adds lexical definitions for declarative top-level definitions, for
  better inlining and contification within a compilation unit.
* am/bootstrap.am:
* module/Makefile.am: Add to build.
2019-08-18 22:27:12 +02:00
Andy Wingo
bba4ce222d Split graph utilities out of (language cps utils)
* module/language/cps/graphs.scm: New file.
* module/language/cps/utils.scm: Re-export functions from graphs.scm.
* am/bootstrap.am:
* module/Makefile.am: Add to build.
2019-08-13 12:53:10 +02:00
Andy Wingo
a6b5049aa8 Emit instrument-loop in loops.
* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES): Handle renamve of handle-interrupts.scm
  to loop-instrumentation.scm.
* libguile/jit.h (SCM_JIT_COUNTER_ENTRY_INCREMENT): Rename from
  SCM_JIT_COUNTER_CALL_INCREMENT.
* libguile/vm-engine.c (instrument-entry): Rename from instrument-call.
* module/language/cps/compile-bytecode.scm (compile-function): Add
  handle-interrupts code before calls and returns.  Compile the
  "instrument-loop" primcall to an "instrument-loop" instruction and a
  "handle-interrupts" instruction.
  (lower-cps): Adapt to add-loop-instrumentation name change.
* module/language/cps/loop-instrumentation.scm: Rename from
  handle-interrupts.scm and just add "instrument-loop" primcalls in
  loops.  The compiler will add handle-interrupts primcalls as
  appropriate.
* module/system/vm/assembler.scm (<jit-data>): New data type, for
  emitting embedded JIT data.
  (<meta>): Add field for current JIT data.
  (make-meta): Initialize current JIT data.
  (emit-instrument-entry*, emit-instrument-loop*): New instruction
  emitters that reference the current JIT data.
  (end-program): Now that all labels are known, arrange to serialize the
  JIT data.
  (link-data): Reserve space for JIT data, and add relocs to initialize
  the "start" / "end" fields.
2018-07-29 15:47:07 +02:00
Andy Wingo
16db934bbc Add (system base optimize) module
* module/system/base/optimize.scm: New module.
* module/Makefile.am (SOURCES):
* am/bootstrap.am (SOURCES): Add new module.
* module/language/tree-il/optimize.scm (tree-il-optimizations): Rename
  from tree-il-default-optimization-options.  Directly specify the
  optimization level at which a pass should be enabled.
* module/language/cps/optimize.scm (cps-optimizations): Likewise, rename
  from cps-default-optimization-options.
* module/scripts/compile.scm (%options, show-optimization-help): Adapt
  to use new module.
2018-01-05 10:19:54 +01:00
Andy Wingo
ad55ee83c3 $throw is a new kind of CPS term
* module/language/cps.scm ($throw): New term type that doesn't have a
  continuation.  Adapt all callers.  Remove now-unneeded
  "prune-bailouts" pass.
2018-01-03 21:25:55 +01:00
Andy Wingo
0b4c1e2c29 Remove inline-constructors pass
* module/language/cps/constructors.scm: Remove pass, as "list" and
  "vector" are now inlined by CPS conversion, and nothing in the
  optimizer reifies "list" or "vector" primcalls.
* module/language/cps/optimize.scm (optimize-higher-order-cps)
  (cps-default-optimization-options):
* am/bootstrap.am:
* module/Makefile.am: Remove references to inline-constructors pass.
2017-12-27 15:46:31 +01:00
Andy Wingo
7f7cbe8b65 Inline "elide-values" optimization into CPS conversion
* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
  reifying "values" primcalls unless necessary.  Effectively inlines the
  "elide-values" optimization into CPS conversion.
* module/language/cps/elide-values.scm: Remove, as it's now unneeded.
* module/language/cps/optimize.scm (optimize-higher-order-cps):
* module/Makefile.am:
* am/bootstrap.am: Remove elide-values references.
2017-12-27 15:46:31 +01:00
Andy Wingo
36e6a3daca Refactor lowering of Tree-IL primcalls to CPS
* module/language/tree-il/cps-primitives.scm: New file,
  replacing (language cps primitives).  Lists known primitives and their
  relation to Tree-IL explicitly, instead of assuming that any Tree-IL
  primcall that shares a name with a bytecode instruction is a CPS
  primcall.
* module/language/cps/verify.scm: Remove use of (language cps
  primitives) and primcall arity checking.  Would be nice to add this
  back at some point.
* module/language/tree-il/compile-cps.scm (convert): Refactor to use new
  tree-il-primitive->cps-primitive+nargs+nvalues helper.
* module/Makefile.am:
* am/bootstrap.am: Adapt.
2017-12-27 15:46:31 +01:00
Andy Wingo
5c9398099d Add integer devirtualization pass.
* module/language/cps/devirtualize-integers.scm: New pass.
* module/language/cps/optimize.scm:
* module/Makefile.am:
* am/bootstrap.am: Add new pass.
2017-11-24 11:03:46 +01:00
Andy Wingo
38c6f6fabf Add (system base types internal).
* module/system/base/types/internal.scm: New file, extracted
  from (system base types).
* module/system/base/types.scm: Use (system base types internal) and
  adapt to %tc1-pair, %tc2-inum, and %tc3-heap-object name changes.
* module/Makefile.am (SOURCES):
* am/bootstrap.am (SOURCES): Add new file.
2017-10-25 12:55:30 +02:00
Andy Wingo
ca74e3fae5 Add handle-interrupts inst and compiler pass
* libguile/vm-engine.c (vm_engine): Remove initial VM_HANDLE_INTERRUPTS
  call; surely our caller already handled interrupts.  Add
  handle-interrupts opcode.
* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES): Add handle-interrupts.scm.
* module/system/vm/assembler.scm (system):
* module/language/cps/compile-bytecode.scm (compile-function):
  (lower-cps): Add handle-interrupts support.
* module/language/cps/handle-interrupts.scm: New file.
2016-11-16 22:55:45 +01:00
Andy Wingo
38f23e75a5 Add meta/build-env
* meta/build-env.in: New file which sets up an environment that does not
  inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless
  cross-compiling).
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* am/bootstrap.am (.scm.go):
* am/guilec (.scm.go): Use build-env.
* configure.ac: Create build-env.
2016-07-10 14:10:26 +02:00
Andy Wingo
44b3342c4d Load port bindings in separate (ice-9 ports) module
* module/ice-9/ports.scm: New file.
* am/bootstrap.am (SOURCES): Add ice-9/ports.scm.
* libguile/fports.c (scm_init_ice_9_fports): New function.
  (scm_init_fports): Arrange for scm_init_ice_9_fports to be called via
  load-extension, and load snarfed things there.  Move open-file
  definition early, to allow ports to bootstrap.
* libguile/ioext.c (scm_init_ice_9_ioext): New function.
  (scm_init_ioext): Similarly, register scm_init_ice_9_ioext as an
  extension.
* libguile/ports.c (scm_set_current_input_port)
  (scm_set_current_output_port, scm_set_current_error_port): Don't
  define Scheme bindings; do that in Scheme.
* libguile/ports.c (scm_i_set_default_port_encoding):
  (scm_i_default_port_encoding, scm_i_default_port_conversion_handler):
  (scm_i_set_default_port_conversion_handler): Since we now init
  encoding early, remove the "init" flags on these encoding/strategy
  vars.
  (scm_init_ice_9_ports): New function.
  (scm_init_ports): Register scm_init_ice_9_ports extension, and define
  some bindings needed by the bootstrap.
* module/Makefile.am (SOURCES): Add ice-9/ports.scm.
* module/ice-9/boot-9.scm: Remove code that's not on the boot path,
  moving it to ice-9/ports.scm.  At the end, load (ice-9 ports).
* module/ice-9/psyntax.scm (include): Use close-port instead of
  close-input-port.
* module/ice-9/psyntax-pp.scm (include): Regenerate.
2016-04-15 14:07:02 +02:00
Andy Wingo
eccdeb6cc6 Distribute prebuilt bootstraps for common hosts
* am/bootstrap.am: New file, factored out of bootstrap/Makefile.am.
* bootstrap/Makefile.am: Use bootstrap.am.

* prebuilt/Makefile.am:
* prebuilt/i686-pc-linux-gnu/Makefile.am:
* prebuilt/mips-unknown-linux-gnu/Makefile.am:
* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: New files.

* configure.ac: Output the prebuilt/ makefiles.
* Makefile.am: Descend into prebuilt/ when making dist.

* meta/uninstalled-env.in: Arrange to put prebuilt/ in the beginning of
  the GUILE_LOAD_COMPILED_PATH.  Also fix a case where bootstrap/ wasn't
  being correctly added to the load path.
2016-01-29 10:21:44 +01:00