1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

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.
This commit is contained in:
Andy Wingo 2013-11-10 19:27:19 +01:00
parent 863dd87362
commit 4c906ad5a5
10 changed files with 220 additions and 172 deletions

View file

@ -290,7 +290,12 @@ process_dynamic_segment (char *base, Elf_Phdr *dyn_phdr,
{
case 0x0202:
bytecode_kind = BYTECODE_KIND_GUILE_2_2;
if (minor)
/* As we get closer to 2.2, we will allow for backwards
compatibility and we can change this test to ">"
instead of "!=". However until then, to deal with VM
churn it's best to keep these things in
lock-step. */
if (minor != SCM_OBJCODE_MINOR_VERSION)
return "incompatible bytecode version";
break;
default: