Remove make-vm; there will be one vm per thread now.
authorAndy Wingo <wingo@pobox.com>
Thu, 21 Nov 2013 13:59:58 +0000 (14:59 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 21 Nov 2013 14:00:03 +0000 (15:00 +0100)
* libguile/vm.h:
* libguile/vm.c (scm_make_vm): Remove.

* module/system/vm/vm.scm: Remove make-vm export.

* test-suite/tests/control.test ("the-vm"):
* test-suite/tests/coverage.test (%test-vm):
* test-suite/tests/eval.test ("stack overflow"): Adapt tests.

libguile/vm.c
libguile/vm.h
module/system/vm/vm.scm
test-suite/tests/control.test
test-suite/tests/coverage.test
test-suite/tests/eval.test

index acb3250..6bbf251 100644 (file)
@@ -856,15 +856,6 @@ SCM_DEFINE (scm_vm_p, "vm?", 1, 0, 0,
 }
 #undef FUNC_NAME
 
-SCM_DEFINE (scm_make_vm, "make-vm", 0, 0, 0,
-           (void),
-           "")
-#define FUNC_NAME s_scm_make_vm,
-{
-  return make_vm ();
-}
-#undef FUNC_NAME
-
 SCM_DEFINE (scm_vm_ip, "vm:ip", 1, 0, 0,
            (SCM vm),
            "")
index bb07454..e461764 100644 (file)
@@ -56,9 +56,6 @@ SCM_API SCM scm_the_vm_fluid;
 #define SCM_VM_DATA(vm)                ((struct scm_vm *) SCM_CELL_WORD_1 (vm))
 #define SCM_VALIDATE_VM(pos,x) SCM_MAKE_VALIDATE (pos, x, VM_P)
 
-SCM_API SCM scm_the_vm (void);
-SCM_API SCM scm_make_vm (void);
-
 SCM_API SCM scm_the_vm (void);
 SCM_API SCM scm_call_with_vm (SCM vm, SCM proc, SCM args);
 
index 0d6f5cc..8f830cc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; Guile VM core
 
-;;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
+;;; Copyright (C) 2001, 2009, 2010, 2013 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
@@ -20,7 +20,7 @@
 
 (define-module (system vm vm)
   #:export (vm?
-            make-vm the-vm call-with-vm
+            the-vm call-with-vm
             vm:ip vm:sp vm:fp
 
             vm-trace-level set-vm-trace-level!
index 5b292c4..916eb2c 100644 (file)
 
 (with-test-prefix/c&e "the-vm"
 
-  (pass-if "unwind changes VMs"
-    (let ((new-vm  (make-vm))
-          (prev-vm (the-vm))
-          (proc    (lambda (x y)
+  (pass-if "unwind through call-with-vm"
+    (let ((proc    (lambda (x y)
                      (expt x y)))
           (call    (lambda (p x y)
                      (p x y))))
       (catch 'foo
         (lambda ()
-          (call-with-vm new-vm (lambda () (throw 'foo (the-vm)))))
+          (call-with-vm (the-vm) (lambda () (throw 'foo (the-vm)))))
         (lambda (key vm)
           (and (eq? key 'foo)
-               (eq? vm new-vm)
-               (eq? (the-vm) prev-vm)))))))
+               (eq? vm (the-vm))))))))
 
 ;; These tests from Oleg Kiselyov's delim-control-n.scm, available at
 ;; http://okmij.org/ftp/Scheme/delim-control-n.scm.  Public domain.
index 7a7a6c5..126136a 100644 (file)
@@ -33,7 +33,7 @@
        (read-enable 'positions)
        (compile (read input))))))
 
-(define %test-vm (make-vm))
+(define %test-vm (the-vm))
 
 (define test-procedure
   (compile '(lambda (x)
index 8930cf2..67e8240 100644 (file)
@@ -18,7 +18,7 @@
 (define-module (test-suite test-eval)
   :use-module (test-suite lib)
   :use-module ((srfi srfi-1) :select (unfold count))
-  :use-module ((system vm vm) :select (make-vm call-with-vm))
+  :use-module ((system vm vm) :select (the-vm call-with-vm))
   :use-module (ice-9 documentation)
   :use-module (ice-9 local-eval))
 
   ;; FIXME: this test does not test what it is intending to test
   (pass-if-exception "exception raised"
     exception:vm-error
-    (let ((vm    (make-vm))
+    (let ((vm    (the-vm))
           (thunk (let loop () (cons 's (loop)))))
       (call-with-vm vm thunk))))