diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-10 19:27:19 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-10 19:27:19 +0100 |
commit | 4c906ad5a5e0404e8b488b525f6b62f405b4d560 (patch) | |
tree | 3d2f69e6931b4c52811df729f3528d92cec26f7d /module/system/vm/assembler.scm | |
parent | 863dd873628a971176556a1da1bf2ab3f0ff5e55 (diff) | |
download | guile-4c906ad5a5e0404e8b488b525f6b62f405b4d560.tar.gz |
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.
Diffstat (limited to 'module/system/vm/assembler.scm')
-rw-r--r-- | module/system/vm/assembler.scm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm index b2db73ec3..3ba25b39f 100644 --- a/module/system/vm/assembler.scm +++ b/module/system/vm/assembler.scm @@ -1200,6 +1200,10 @@ needed." ;;; the symbol table, etc. ;;; +;; FIXME: Define these somewhere central, shared with C. +(define *bytecode-major-version* #x0202) +(define *bytecode-minor-version* 2) + (define (link-dynamic-section asm text rw rw-init) "Link the dynamic section for an ELF image with RTL text, given the writable data section @var{rw} needing fixup from the procedure with @@ -1219,7 +1223,8 @@ it will be added to the GC roots at runtime." relocs)) (%set-uword! bv (* i word-size) 0 endianness)))) (set-uword! 0 DT_GUILE_RTL_VERSION) - (set-uword! 1 #x02020000) + (set-uword! 1 (logior (ash *bytecode-major-version* 16) + *bytecode-minor-version*)) (set-uword! 2 DT_GUILE_ENTRY) (set-label! 3 '.rtl-text) (cond |