remove vm-version, vm options
authorAndy Wingo <wingo@pobox.com>
Sat, 25 Sep 2010 10:16:05 +0000 (12:16 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 25 Sep 2010 10:16:05 +0000 (12:16 +0200)
* libguile/vm.h (struct scm_vm): Remove "options" member.
* libguile/vm.c (scm_vm_version, scm_vm_option, scm_set_vm_option_x):
  Remove.

* module/system/vm/vm.scm (vm-version, vm-option, set-vm-option!):
  Remove.
  (vms:time, vms:clock): Remove these unused definitions.
  (vm-load): Remove. "Load" should be reserved for things that exist on
  disk, methinks.

libguile/vm.c
libguile/vm.h
module/system/vm/vm.scm
test-suite/tests/compiler.test
test-suite/vm/run-vm-tests.scm

index b229c27..7512d10 100644 (file)
@@ -513,7 +513,6 @@ make_vm (void)
   vp->sp         = vp->stack_base - 1;
   vp->fp         = NULL;
   vp->engine      = SCM_VM_DEBUG_ENGINE;
-  vp->options     = SCM_EOL;
   vp->trace_level = 0;
   for (i = 0; i < SCM_VM_NUM_HOOKS; i++)
     vp->hooks[i] = SCM_BOOL_F;
@@ -588,15 +587,6 @@ SCM_DEFINE (scm_vm_apply, "vm-apply", 3, 0, 0,
 
 /* Scheme interface */
 
-SCM_DEFINE (scm_vm_version, "vm-version", 0, 0, 0,
-           (void),
-           "")
-#define FUNC_NAME s_scm_vm_version
-{
-  return scm_from_locale_string (PACKAGE_VERSION);
-}
-#undef FUNC_NAME
-
 /* Return T's VM.  */
 static inline SCM
 thread_vm (scm_i_thread *t)
@@ -759,28 +749,6 @@ SCM_DEFINE (scm_vm_restore_continuation_hook, "vm-restore-continuation-hook", 1,
 }
 #undef FUNC_NAME
 
-SCM_DEFINE (scm_vm_option, "vm-option", 2, 0, 0,
-           (SCM vm, SCM key),
-           "")
-#define FUNC_NAME s_scm_vm_option
-{
-  SCM_VALIDATE_VM (1, vm);
-  return scm_assq_ref (SCM_VM_DATA (vm)->options, key);
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_set_vm_option_x, "set-vm-option!", 3, 0, 0,
-           (SCM vm, SCM key, SCM val),
-           "")
-#define FUNC_NAME s_scm_set_vm_option_x
-{
-  SCM_VALIDATE_VM (1, vm);
-  SCM_VM_DATA (vm)->options
-    = scm_assq_set_x (SCM_VM_DATA (vm)->options, key, val);
-  return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
 SCM_DEFINE (scm_vm_trace_level, "vm-trace-level", 1, 0, 0,
            (SCM vm),
            "")
index 86b096d..36dc1dc 100644 (file)
@@ -49,7 +49,6 @@ struct scm_vm {
   SCM *stack_limit;            /* stack limit address */
   int engine;                   /* which vm engine we're using */
   SCM hooks[SCM_VM_NUM_HOOKS]; /* hooks */
-  SCM options;                 /* options */
   int trace_level;              /* traces enabled if trace_level > 0 */
   scm_t_int64 cookie;           /* used to detect unrewindable continuations */
 };
@@ -65,7 +64,6 @@ SCM_API SCM scm_make_vm (void);
 SCM_API SCM scm_vm_apply (SCM vm, SCM program, SCM args);
 SCM_API SCM scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs);
 
-SCM_API SCM scm_vm_version (void);
 SCM_API SCM scm_thread_vm (SCM t);
 SCM_API SCM scm_set_thread_vm_x (SCM t, SCM vm);
 SCM_API SCM scm_the_vm (void);
@@ -79,8 +77,6 @@ SCM_API SCM scm_vm_pop_continuation_hook (SCM vm);
 SCM_API SCM scm_vm_abort_continuation_hook (SCM vm);
 SCM_API SCM scm_vm_restore_continuation_hook (SCM vm);
 SCM_API SCM scm_vm_next_hook (SCM vm);
-SCM_API SCM scm_vm_option (SCM vm, SCM key);
-SCM_API SCM scm_set_vm_option_x (SCM vm, SCM key, SCM val);
 SCM_API SCM scm_vm_trace_level (SCM vm);
 SCM_API SCM scm_set_vm_trace_level_x (SCM vm, SCM level);
 
index 66afdbb..874d5c8 100644 (file)
@@ -25,9 +25,6 @@
             the-vm thread-vm set-thread-vm!
             vm:ip vm:sp vm:fp vm:last-ip
 
-            vm-load vm-option set-vm-option! vm-version
-            vms:time vms:clock
-
             vm-trace-level set-vm-trace-level!
             vm-push-continuation-hook vm-pop-continuation-hook
             vm-apply-hook
@@ -36,9 +33,3 @@
 
 (load-extension (string-append "libguile-" (effective-version))
                 "scm_init_vm")
-
-(define (vms:time stat) (vector-ref stat 0))
-(define (vms:clock stat) (vector-ref stat 1))
-
-(define (vm-load vm objcode)
-  (vm-apply vm (make-program objcode) '()))
index 90538ac..f600fe2 100644 (file)
@@ -19,8 +19,9 @@
   #:use-module (test-suite lib)
   #:use-module (test-suite guile-test)
   #:use-module (system base compile)
-  #:use-module ((system vm vm) #:select (the-vm vm-load))
-  #:use-module ((system vm program) #:select (program-sources source:addr)))
+  #:use-module ((system vm vm) #:select (the-vm vm-apply))
+  #:use-module ((system vm program) #:select (make-program
+                                              program-sources source:addr)))
 
 (define read-and-compile
   (@@ (system base compile) read-and-compile))
@@ -97,7 +98,7 @@
                      #f)
                    (install-reader!)
                    this-should-be-ignored")))
-      (and (eq? (vm-load (the-vm) (read-and-compile input))
+      (and (eq? (vm-apply (the-vm) (make-program (read-and-compile input)) '())
                 'ok)
            (eq? r (fluid-ref current-reader)))))
 
index 39e7bf1..f699fdf 100644 (file)
@@ -1,6 +1,6 @@
 ;;; run-vm-tests.scm -- Run Guile-VM's test suite.
 ;;;
-;;; Copyright 2005, 2009 Free Software Foundation, Inc.
+;;; Copyright 2005, 2009, 2010 Free Software Foundation, Inc.
 ;;;
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU Lesser General Public License
@@ -18,6 +18,7 @@
 
 
 (use-modules (system vm vm)
+             (system vm program)
             (system base compile)
             (system base language)
              (language scheme spec)
@@ -41,7 +42,7 @@
 
 (define (run-vm-program objcode)
   "Run VM program contained into @var{objcode}."
-  (vm-load (the-vm) objcode))
+  (vm-apply (the-vm) (make-program objcode) '()))
 
 (define (compile/run-test-from-file file)
   "Run test from source file @var{file} and return a value indicating whether