mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Reflection support for unboxed f64 slots
* module/system/vm/assembler.scm (emit-definition): Add representation field. (write-arities): Emit representations into the arities section. * module/system/vm/debug.scm (arity-definitions): Read representations. * module/system/vm/frame.scm (<binding>): Add representation field and binding-representation getter. (available-bindings): Pass representation to make-binding. (frame-binding-set!, frame-binding-ref, frame-call-representation): Pass representation to frame-local-ref / frame-local-set!. * test-suite/tests/rtl.test: Update definition instructions. * module/language/cps/slot-allocation.scm ($allocation): Add representations field. (lookup-representation): New public function. (allocate-slots): Pass representations to make-$allocation. * module/language/cps/compile-bytecode.scm (compile-function): Adapt to emit-definition change. * libguile/frames.h: * libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Take representation argument. (scm_to_stack_item_representation): New internal helper.
This commit is contained in:
parent
e7660a607c
commit
e3cc0eeb3a
9 changed files with 149 additions and 77 deletions
|
@ -1,6 +1,6 @@
|
|||
;;; Guile runtime debug information
|
||||
|
||||
;;; Copyright (C) 2013, 2014 Free Software Foundation, Inc.
|
||||
;;; Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc.
|
||||
;;;
|
||||
;;; This library is free software; you can redistribute it and/or
|
||||
;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -381,9 +381,14 @@ section of the ELF image. Returns an ELF symbol, or @code{#f}."
|
|||
(call-with-values (lambda () (read-uleb128 bv pos))
|
||||
(lambda (def-offset pos)
|
||||
(call-with-values (lambda () (read-uleb128 bv pos))
|
||||
(lambda (slot pos)
|
||||
(cons (vector name def-offset slot)
|
||||
(lp pos names))))))))))
|
||||
(lambda (slot+representation pos)
|
||||
(let ((slot (ash slot+representation -2))
|
||||
(representation (case (logand slot+representation #x3)
|
||||
((0) 'scm)
|
||||
((1) 'f64)
|
||||
(else 'unknown))))
|
||||
(cons (vector name def-offset slot representation)
|
||||
(lp pos names)))))))))))
|
||||
(define (load-symbols pos)
|
||||
(let lp ((pos pos) (n nlocals) (out '()))
|
||||
(if (zero? n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue