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

tc7 tags for vm-related data

* libguile/tags.h (scm_tc7_frame, scm_tc7_objcode, scm_tc7_vm)
  (scm_tc7_vm_cont): Take more tc7s for VM-related data structures.

* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c (scm_class_of, create_standard_classes):
* libguile/print.c (iprin1): Add cases for the new tc7s.

* libguile/frames.c:
* libguile/frames.h:
* libguile/objcodes.c:
* libguile/objcodes.h:
* libguile/vm.c:
* libguile/vm.h: Desmobify.

* libguile/vm.c (scm_vm_apply): Export to Scheme, because VM objects are
  no longer applicable.

* module/system/repl/command.scm (profile):
* module/system/vm/trace.scm (vm-trace):
* module/system/vm/vm.scm (vm-load): Call vm-apply to run a program in a
  VM instead of treating the VM as applicable.
This commit is contained in:
Andy Wingo 2010-01-05 19:45:56 +01:00
parent a6029b97ea
commit 6f3b0cc29e
15 changed files with 119 additions and 78 deletions

View file

@ -1,6 +1,6 @@
;;; Repl commands
;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2009, 2010 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
@ -367,7 +367,7 @@ Profile execution."
;; FIXME opts
(let ((vm (repl-vm repl))
(proc (make-program (repl-compile repl (repl-parse repl form)))))
(with-statprof #:hz 100 (vm proc))))
(with-statprof #:hz 100 (vm-apply vm proc '()))))

View file

@ -1,6 +1,6 @@
;;; Guile VM tracer
;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2009, 2010 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
@ -28,7 +28,7 @@
(define (vm-trace vm thunk . opts)
(dynamic-wind
(lambda () (apply vm-trace-on! vm opts))
(lambda () (vm thunk))
(lambda () (vm-apply vm thunk '()))
(lambda () (apply vm-trace-off! vm opts))))
(define* (vm-trace-on! vm #:key (calls? #t) (instructions? #f))

View file

@ -1,6 +1,6 @@
;;; Guile VM core
;;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
;;; Copyright (C) 2001, 2009, 2010 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
@ -21,7 +21,7 @@
(define-module (system vm vm)
#:use-module (system vm frame)
#:use-module (system vm program)
#:export (vm? the-vm make-vm vm-version
#:export (vm? the-vm make-vm vm-version vm-apply
vm:ip vm:sp vm:fp vm:last-ip
vm-load vm-option set-vm-option! vm-version
@ -37,4 +37,4 @@
(define (vms:clock stat) (vector-ref stat 1))
(define (vm-load vm objcode)
(vm (make-program objcode)))
(vm-apply vm (make-program objcode) '()))