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

7 commits

Author SHA1 Message Date
Andy Wingo
dd203e5d7d Remove optimizer and backend support for struct ops
* module/language/cps/compile-bytecode.scm:
* module/language/cps/cse.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/types.scm:
* module/language/tree-il/cps-primitives.scm:
* module/system/vm/assembler.scm: Remove support for struct-ref,
  struct-set!, allocate-struct, struct-vtable CPS primcalls and bytecode
  instructions.
2018-01-22 07:51:08 +01:00
Andy Wingo
91bf9b1db3 Lower "make-struct/simple" to CPS
* module/language/tree-il/cps-primitives.scm (struct-init!): Add
  primitive, just used in internal translations.
* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
  (*primitive-constructors*): Recognize "make-struct/simple" instead of
  allocate-struct.
* module/language/tree-il/compile-cps.scm (ensure-vtable): New helper.
  (allocate-struct, struct-init!): New lowerers.
  (convert): Add struct-init! case.
  (canonicalize): Convert make-struct/simple like vector.
2018-01-22 07:28:11 +01:00
Andy Wingo
557acdbbba Instruction explosion for struct-ref, struct-set!
* module/language/cps/effects-analysis.scm (&memory-kind-mask): Add
  &bitmask, for the bitmask in vtables.
  (annotation->memory-kind): Add 'bitmask case.
* module/language/tree-il/compile-cps.scm (ensure-struct-index-in-range):
  (prepare-struct-scm-access): New helpers.
  (struct-ref/immediate, struct-set!/immediate): New exploded lowering
  routines.
  (struct-ref, struct-set!): New lowering routines that just do a call.
  (canonicalize): Remove struct-ref hack; lowering procedures will
  handle it.
* module/language/tree-il/cps-primitives.scm (bytevector-length): Define
  struct-set! as returning a value.
2018-01-19 21:57:03 +01:00
Andy Wingo
5e1109a97f Better compilation of vector constructors and initializers
* module/language/tree-il/cps-primitives.scm (allocate-vector)
  (vector-init!): Declare these primitives which later go away when
  lowering to CPS.
* module/language/tree-il/compile-cps.scm (vector-init!): New
  converter.
  (allocate-vector): New converter.
2018-01-07 22:51:17 +01:00
Andy Wingo
3cedc108d8 Add CPS compilation support for mutable-vector?
* module/system/base/types/internal.scm (heap-tags): Add
  immutable-vector? and mutable-vector?.
* module/language/tree-il/cps-primitives.scm:
* module/system/vm/disassembler.scm: Bump copyright lines.
2018-01-07 16:41:40 +01:00
Andy Wingo
108ade6b0e Re-add support for logbit?
* module/language/cps/type-fold.scm (logbit?): Adapt for logbit?
  continuing to $kargs.
* module/language/tree-il/cps-primitives.scm (logbit?): Declare this CPS
  primitive.
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