1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 07:30:32 +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:
Andy Wingo 2015-10-28 17:03:42 +00:00
parent e7660a607c
commit e3cc0eeb3a
9 changed files with 149 additions and 77 deletions

View file

@ -113,7 +113,8 @@
(format port "~aLocal variables:~%" per-line-prefix)
(for-each
(lambda (binding)
(let ((v (frame-local-ref frame (binding-slot binding))))
(let ((v (frame-local-ref frame (binding-slot binding)
(binding-representation binding))))
(display per-line-prefix port)
(run-hook before-print-hook v)
(format port "~a = ~v:@y\n" (binding-name binding) width v)))
@ -174,7 +175,8 @@
(module-use! mod* mod)
(for-each
(lambda (binding)
(let* ((x (frame-local-ref frame (binding-slot binding)))
(let* ((x (frame-local-ref frame (binding-slot binding)
(binding-representation binding)))
(var (if (variable? x) x (make-variable x))))
(format #t
"~:[Read-only~;Mutable~] local variable ~a = ~70:@y\n"