]> gitweb.factorcode.org Git - factor.git/commitdiff
Removed VM_PTR macros. All builds reentrant by default
authorPhil Dawes <phil@phildawes.net>
Wed, 14 Oct 2009 18:14:57 +0000 (19:14 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 14 Oct 2009 18:14:57 +0000 (19:14 +0100)
17 files changed:
vm/alien.cpp
vm/booleans.cpp
vm/callstack.cpp
vm/code_block.cpp
vm/contexts.cpp
vm/errors.cpp
vm/gc.cpp
vm/inline_cache.cpp
vm/math.cpp
vm/os-linux-arm.cpp
vm/os-linux.cpp
vm/os-unix.cpp
vm/os-windows-nt.cpp
vm/primitives.hpp
vm/quotations.cpp
vm/tagged.hpp
vm/vm.hpp

index 537a62de9a28fcc5e5f711dfa5bfbd4c0c8fc61a..84e40a46132a62c8580b72458d32dd724e1fc917 100755 (executable)
@@ -87,12 +87,12 @@ void *factor_vm::alien_pointer()
 #define DEFINE_ALIEN_ACCESSOR(name,type,boxer,to) \
        PRIMITIVE(alien_##name) \
        { \
-               PRIMITIVE_GETVM()->boxer(*(type*)PRIMITIVE_GETVM()->alien_pointer());   \
+               ((factor_vm*)myvm)->boxer(*(type*)((factor_vm*)myvm)->alien_pointer()); \
        } \
        PRIMITIVE(set_alien_##name) \
        { \
-               type *ptr = (type *)PRIMITIVE_GETVM()->alien_pointer(); \
-               type value = PRIMITIVE_GETVM()->to(dpop()); \
+               type *ptr = (type *)((factor_vm*)myvm)->alien_pointer(); \
+               type value = ((factor_vm*)myvm)->to(dpop()); \
                *ptr = value; \
        }
 
@@ -184,8 +184,7 @@ char *factor_vm::alien_offset(cell obj)
 
 VM_C_API char *alien_offset(cell obj, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->alien_offset(obj);
+       return myvm->alien_offset(obj);
 }
 
 /* pop an object representing a C pointer */
@@ -196,8 +195,7 @@ char *factor_vm::unbox_alien()
 
 VM_C_API char *unbox_alien(factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->unbox_alien();
+       return myvm->unbox_alien();
 }
 
 /* make an alien and push */
@@ -211,8 +209,7 @@ void factor_vm::box_alien(void *ptr)
 
 VM_C_API void box_alien(void *ptr, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_alien(ptr);
+       return myvm->box_alien(ptr);
 }
 
 /* for FFI calls passing structs by value */
@@ -223,8 +220,7 @@ void factor_vm::to_value_struct(cell src, void *dest, cell size)
 
 VM_C_API void to_value_struct(cell src, void *dest, cell size, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_value_struct(src,dest,size);
+       return myvm->to_value_struct(src,dest,size);
 }
 
 /* for FFI callbacks receiving structs by value */
@@ -237,8 +233,7 @@ void factor_vm::box_value_struct(void *src, cell size)
 
 VM_C_API void box_value_struct(void *src, cell size,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_value_struct(src,size);
+       return myvm->box_value_struct(src,size);
 }
 
 /* On some x86 OSes, structs <= 8 bytes are returned in registers. */
@@ -252,8 +247,7 @@ void factor_vm::box_small_struct(cell x, cell y, cell size)
 
 VM_C_API void box_small_struct(cell x, cell y, cell size, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_small_struct(x,y,size);
+       return myvm->box_small_struct(x,y,size);
 }
 
 /* On OS X/PPC, complex numbers are returned in registers. */
@@ -269,8 +263,7 @@ void factor_vm::box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size)
 
 VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_medium_struct(x1, x2, x3, x4, size);
+       return myvm->box_medium_struct(x1, x2, x3, x4, size);
 }
 
 void factor_vm::primitive_vm_ptr()
index 5e3cb038225c05b213460520437364bb3dcc4f32..f1f0230c1363e3513e01115361a55365ff46cfe1 100644 (file)
@@ -10,8 +10,7 @@ void factor_vm::box_boolean(bool value)
 
 VM_C_API void box_boolean(bool value, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_boolean(value);
+       return myvm->box_boolean(value);
 }
 
 bool factor_vm::to_boolean(cell value)
@@ -21,8 +20,7 @@ bool factor_vm::to_boolean(cell value)
 
 VM_C_API bool to_boolean(cell value, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_boolean(value);
+       return myvm->to_boolean(value);
 }
 
 }
index 954eedcecbcccb9f3cc40e72c13edf870305fbbc..3d752913c739494ce2bc93c1b956a12487fb0f86 100755 (executable)
@@ -209,8 +209,7 @@ void factor_vm::save_callstack_bottom(stack_frame *callstack_bottom)
 
 VM_ASM_API void save_callstack_bottom(stack_frame *callstack_bottom, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->save_callstack_bottom(callstack_bottom);
+       return myvm->save_callstack_bottom(callstack_bottom);
 }
 
 }
index 24c68c90ce591aed3872b7642684f6b0eb65331b..736d74d5d139d1b2abaf3a2ce938a075a4ff344d 100755 (executable)
@@ -95,7 +95,7 @@ void factor_vm::undefined_symbol()
 
 void undefined_symbol()
 {
-       return SIGNAL_VM_PTR()->undefined_symbol();
+       return tls_vm()->undefined_symbol();
 }
 
 /* Look up an external library symbol referenced by a compiled code block */
index 78dc2ccd3fd013ebe461f4ea0d4a0652d5b944f9..53904937dcb4f964787785239b3e8ff5d2ecea6f 100644 (file)
@@ -91,8 +91,7 @@ void factor_vm::nest_stacks()
 
 void nest_stacks(factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->nest_stacks();
+       return myvm->nest_stacks();
 }
 
 /* called when leaving a compiled callback */
@@ -112,8 +111,7 @@ void factor_vm::unnest_stacks()
 
 void unnest_stacks(factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->unnest_stacks();
+       return myvm->unnest_stacks();
 }
 
 /* called on startup */
index fc79603e67e92bfcd120d0905775ebafc15d21b5..0ea3589eecba22411a01f75fc152726668f7d400 100755 (executable)
@@ -15,13 +15,13 @@ void critical_error(const char *msg, cell tagged)
        print_string("You have triggered a bug in Factor. Please report.\n");
        print_string("critical_error: "); print_string(msg);
        print_string(": "); print_cell_hex(tagged); nl();
-       SIGNAL_VM_PTR()->factorbug();
+       tls_vm()->factorbug();
 }
 
 void out_of_memory()
 {
        print_string("Out of memory\n\n");
-       SIGNAL_VM_PTR()->dump_generations();
+       tls_vm()->dump_generations();
        exit(1);
 }
 
@@ -146,7 +146,7 @@ void factor_vm::memory_signal_handler_impl()
 
 void memory_signal_handler_impl()
 {
-       SIGNAL_VM_PTR()->memory_signal_handler_impl();
+       tls_vm()->memory_signal_handler_impl();
 }
 
 void factor_vm::misc_signal_handler_impl()
@@ -156,7 +156,7 @@ void factor_vm::misc_signal_handler_impl()
 
 void misc_signal_handler_impl()
 {
-       SIGNAL_VM_PTR()->misc_signal_handler_impl();
+       tls_vm()->misc_signal_handler_impl();
 }
 
 void factor_vm::fp_signal_handler_impl()
@@ -166,7 +166,7 @@ void factor_vm::fp_signal_handler_impl()
 
 void fp_signal_handler_impl()
 {
-       SIGNAL_VM_PTR()->fp_signal_handler_impl();
+       tls_vm()->fp_signal_handler_impl();
 }
 
 }
index 3850dc642ecd3a979013c1d8ee81acf759d06ad4..f52c13d889f1a6287df44cfb6df5cb81d1a83978 100755 (executable)
--- a/vm/gc.cpp
+++ b/vm/gc.cpp
@@ -207,8 +207,7 @@ void factor_vm::inline_gc(cell *gc_roots_base, cell gc_roots_size)
 
 VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm)
 {
-       ASSERTVM();
-       VM_PTR->inline_gc(gc_roots_base,gc_roots_size);
+       myvm->inline_gc(gc_roots_base,gc_roots_size);
 }
 
 /*
index 18d784a2c0af718ffbaaaaad2ceef05fb7e23428..7f7471ad1f8e0dbca4ff0e7ec7f66d5271a00e95 100755 (executable)
@@ -250,8 +250,7 @@ void *factor_vm::inline_cache_miss(cell return_address)
 
 VM_C_API void *inline_cache_miss(cell return_address, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->inline_cache_miss(return_address);
+       return myvm->inline_cache_miss(return_address);
 }
 
 void factor_vm::primitive_reset_inline_cache_stats()
index 93f0c695dba01e3ce68426c356ef47eaf766ad27..e4caa0f5ca417d55ef383ff316dd4a32e5ebb014 100755 (executable)
@@ -395,8 +395,7 @@ fixnum factor_vm::to_fixnum(cell tagged)
 
 VM_C_API fixnum to_fixnum(cell tagged,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_fixnum(tagged);
+       return myvm->to_fixnum(tagged);
 }
 
 cell factor_vm::to_cell(cell tagged)
@@ -406,8 +405,7 @@ cell factor_vm::to_cell(cell tagged)
 
 VM_C_API cell to_cell(cell tagged, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_cell(tagged);
+       return myvm->to_cell(tagged);
 }
 
 void factor_vm::box_signed_1(s8 n)
@@ -417,8 +415,7 @@ void factor_vm::box_signed_1(s8 n)
 
 VM_C_API void box_signed_1(s8 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_signed_1(n);
+       return myvm->box_signed_1(n);
 }
 
 void factor_vm::box_unsigned_1(u8 n)
@@ -428,8 +425,7 @@ void factor_vm::box_unsigned_1(u8 n)
 
 VM_C_API void box_unsigned_1(u8 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_unsigned_1(n);
+       return myvm->box_unsigned_1(n);
 }
 
 void factor_vm::box_signed_2(s16 n)
@@ -439,8 +435,7 @@ void factor_vm::box_signed_2(s16 n)
 
 VM_C_API void box_signed_2(s16 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_signed_2(n);
+       return myvm->box_signed_2(n);
 }
 
 void factor_vm::box_unsigned_2(u16 n)
@@ -450,8 +445,7 @@ void factor_vm::box_unsigned_2(u16 n)
 
 VM_C_API void box_unsigned_2(u16 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_unsigned_2(n);
+       return myvm->box_unsigned_2(n);
 }
 
 void factor_vm::box_signed_4(s32 n)
@@ -461,8 +455,7 @@ void factor_vm::box_signed_4(s32 n)
 
 VM_C_API void box_signed_4(s32 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_signed_4(n);
+       return myvm->box_signed_4(n);
 }
 
 void factor_vm::box_unsigned_4(u32 n)
@@ -472,8 +465,7 @@ void factor_vm::box_unsigned_4(u32 n)
 
 VM_C_API void box_unsigned_4(u32 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_unsigned_4(n);
+       return myvm->box_unsigned_4(n);
 }
 
 void factor_vm::box_signed_cell(fixnum integer)
@@ -483,8 +475,7 @@ void factor_vm::box_signed_cell(fixnum integer)
 
 VM_C_API void box_signed_cell(fixnum integer,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_signed_cell(integer);
+       return myvm->box_signed_cell(integer);
 }
 
 void factor_vm::box_unsigned_cell(cell cell)
@@ -494,8 +485,7 @@ void factor_vm::box_unsigned_cell(cell cell)
 
 VM_C_API void box_unsigned_cell(cell cell,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_unsigned_cell(cell);
+       return myvm->box_unsigned_cell(cell);
 }
 
 void factor_vm::box_signed_8(s64 n)
@@ -508,8 +498,7 @@ void factor_vm::box_signed_8(s64 n)
 
 VM_C_API void box_signed_8(s64 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_signed_8(n);
+       return myvm->box_signed_8(n);
 }
 
 s64 factor_vm::to_signed_8(cell obj)
@@ -528,8 +517,7 @@ s64 factor_vm::to_signed_8(cell obj)
 
 VM_C_API s64 to_signed_8(cell obj,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_signed_8(obj);
+       return myvm->to_signed_8(obj);
 }
 
 void factor_vm::box_unsigned_8(u64 n)
@@ -542,8 +530,7 @@ void factor_vm::box_unsigned_8(u64 n)
 
 VM_C_API void box_unsigned_8(u64 n,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_unsigned_8(n);
+       return myvm->box_unsigned_8(n);
 }
 
 u64 factor_vm::to_unsigned_8(cell obj)
@@ -562,8 +549,7 @@ u64 factor_vm::to_unsigned_8(cell obj)
 
 VM_C_API u64 to_unsigned_8(cell obj,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_unsigned_8(obj);
+       return myvm->to_unsigned_8(obj);
 }
  
 void factor_vm::box_float(float flo)
@@ -573,8 +559,7 @@ void factor_vm::box_float(float flo)
 
 VM_C_API void box_float(float flo, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_float(flo);
+       return myvm->box_float(flo);
 }
 
 float factor_vm::to_float(cell value)
@@ -584,8 +569,7 @@ float factor_vm::to_float(cell value)
 
 VM_C_API float to_float(cell value,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_float(value);
+       return myvm->to_float(value);
 }
 
 void factor_vm::box_double(double flo)
@@ -595,8 +579,7 @@ void factor_vm::box_double(double flo)
 
 VM_C_API void box_double(double flo,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->box_double(flo);
+       return myvm->box_double(flo);
 }
 
 double factor_vm::to_double(cell value)
@@ -606,8 +589,7 @@ double factor_vm::to_double(cell value)
 
 VM_C_API double to_double(cell value,factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->to_double(value);
+       return myvm->to_double(value);
 }
 
 /* The fixnum+, fixnum- and fixnum* primitives are defined in cpu_*.S. On
@@ -620,7 +602,7 @@ inline void factor_vm::overflow_fixnum_add(fixnum x, fixnum y)
 
 VM_ASM_API void overflow_fixnum_add(fixnum x, fixnum y, factor_vm *myvm)
 {
-       PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_add(x,y);
+       ((factor_vm*)myvm)->overflow_fixnum_add(x,y);
 }
 
 inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
@@ -631,7 +613,7 @@ inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
 
 VM_ASM_API void overflow_fixnum_subtract(fixnum x, fixnum y, factor_vm *myvm)
 {
-       PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_subtract(x,y);
+       ((factor_vm*)myvm)->overflow_fixnum_subtract(x,y);
 }
 
 inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
@@ -645,7 +627,7 @@ inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
 
 VM_ASM_API void overflow_fixnum_multiply(fixnum x, fixnum y, factor_vm *myvm)
 {
-       PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_multiply(x,y);
+       ((factor_vm*)myvm)->overflow_fixnum_multiply(x,y);
 }
 
 }
index 0f459d5ec5778f66c229043fd2abf3187c022c84..07eda12186d1437466ed8dec4c8c48a927228f59 100644 (file)
@@ -25,7 +25,7 @@ void flush_icache(cell start, cell len)
                : "r0","r1","r2");
 
        if(result < 0)
-               SIGNAL_VM_PTR->critical_error("flush_icache() failed",result);
+               tls_vm()critical_error("flush_icache() failed",result);
 }
 
 }
index 352467d37962a92bcbc6941768e0b383f4ea29c5..2bd313e1c0c53d8d64c72ca286a8bf180781e30d 100644 (file)
@@ -45,19 +45,19 @@ VM_C_API int inotify_rm_watch(int fd, u32 wd)
 
 VM_C_API int inotify_init()
 {
-       VM_PTR->not_implemented_error();
+       myvm->not_implemented_error();
        return -1;
 }
 
 VM_C_API int inotify_add_watch(int fd, const char *name, u32 mask)
 {
-       VM_PTR->not_implemented_error();
+       myvm->not_implemented_error();
        return -1;
 }
 
 VM_C_API int inotify_rm_watch(int fd, u32 wd)
 {
-       VM_PTR->not_implemented_error();
+       myvm->not_implemented_error();
        return -1;
 }
 
index e792483e0de65e2aee5f139289d4cf17e62cdfc5..d80ae91070e4b29a982649850fda35737b4cffaf 100644 (file)
@@ -139,7 +139,7 @@ void factor_vm::memory_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 
 void memory_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 {
-       SIGNAL_VM_PTR()->memory_signal_handler(signal,siginfo,uap);
+       tls_vm()->memory_signal_handler(signal,siginfo,uap);
 }
 
 void factor_vm::misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
@@ -151,7 +151,7 @@ void factor_vm::misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 
 void misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 {
-       SIGNAL_VM_PTR()->misc_signal_handler(signal,siginfo,uap);
+       tls_vm()->misc_signal_handler(signal,siginfo,uap);
 }
 
 void factor_vm::fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
@@ -168,7 +168,7 @@ void factor_vm::fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 
 void fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 {
-       SIGNAL_VM_PTR()->fpe_signal_handler(signal, siginfo, uap);
+       tls_vm()->fpe_signal_handler(signal, siginfo, uap);
 }
 
 static void sigaction_safe(int signum, const struct sigaction *act, struct sigaction *oldact)
index e8f3e1ec9853e47a0635fe29f7a638d0a500d6f2..0c5ddd99e19b40ae46eebe4e8606e78243cf0e79 100755 (executable)
@@ -85,7 +85,7 @@ LONG factor_vm::exception_handler(PEXCEPTION_POINTERS pe)
 
 FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
 {
-       return SIGNAL_VM_PTR()->exception_handler(pe);
+       return tls_vm()->exception_handler(pe);
 }
 
 bool handler_added = 0;
index cff22bf5fc4f772df138a1bdd9fb7c499e3c1a2e..7eaa13d8a17c6b58944316ddfc53c3a5a7f95eb4 100644 (file)
@@ -6,14 +6,14 @@ namespace factor
   #define PRIMITIVE(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm)
   #define PRIMITIVE_FORWARD(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm) \
   {                                                                    \
-       PRIMITIVE_GETVM()->primitive_##name();                          \
+       ((factor_vm*)myvm)->primitive_##name();                         \
   }
 #else
   extern "C" typedef void (*primitive_type)(void *myvm);
   #define PRIMITIVE(name) extern "C" void primitive_##name(void *myvm)
   #define PRIMITIVE_FORWARD(name) extern "C" void primitive_##name(void *myvm) \
   {                                                                    \
-       PRIMITIVE_GETVM()->primitive_##name();                          \
+       ((factor_vm*)myvm)->primitive_##name();                         \
   }
 #endif
 extern const primitive_type primitives[];
index afb02bb48545bdd3c7eb32704f314d556846408b..f20fce208272caaf17d3c02954f15e6cf1007172 100755 (executable)
@@ -369,8 +369,7 @@ cell factor_vm::lazy_jit_compile_impl(cell quot_, stack_frame *stack)
 
 VM_ASM_API cell lazy_jit_compile_impl(cell quot_, stack_frame *stack, factor_vm *myvm)
 {
-       ASSERTVM();
-       return VM_PTR->lazy_jit_compile_impl(quot_,stack);
+       return myvm->lazy_jit_compile_impl(quot_,stack);
 }
 
 void factor_vm::primitive_quot_compiled_p()
index 66cfa27c17d29499cabd70206cfc3aabddedbc09..e7a83d0111b44dfab83377e01dc6b321632ae003 100755 (executable)
@@ -37,13 +37,13 @@ struct tagged
 
        explicit tagged(cell tagged) : value_(tagged) {
 #ifdef FACTOR_DEBUG
-               untag_check(SIGNAL_VM_PTR());
+               untag_check(tls_vm());
 #endif
        }
 
        explicit tagged(Type *untagged) : value_(factor::tag(untagged)) {
 #ifdef FACTOR_DEBUG
-               untag_check(SIGNAL_VM_PTR()); 
+               untag_check(tls_vm()); 
 #endif
        }
 
index c89268f9b6059d83322f7ee531ecdf21a31947e1..943f4158f098f02271a29c5478a3ec3f140c29e7 100755 (executable)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -712,47 +712,6 @@ struct factor_vm
 
 };
 
-#ifndef FACTOR_REENTRANT
-        #define FACTOR_SINGLE_THREADED_TESTING
-#endif
-
-#ifdef FACTOR_SINGLE_THREADED_SINGLETON
-/* calls are dispatched using the singleton vm ptr */
-        extern factor_vm *vm;
-        #define PRIMITIVE_GETVM() vm
-        #define PRIMITIVE_OVERFLOW_GETVM() vm
-        #define VM_PTR vm
-        #define ASSERTVM()
-        #define SIGNAL_VM_PTR() vm
-#endif
-
-#ifdef FACTOR_SINGLE_THREADED_TESTING
-/* calls are dispatched as per multithreaded, but checked against singleton */
-        extern factor_vm *vm;
-        #define ASSERTVM() assert(vm==myvm)
-        #define PRIMITIVE_GETVM() ((factor_vm*)myvm)
-        #define PRIMITIVE_OVERFLOW_GETVM() ASSERTVM(); myvm
-        #define VM_PTR myvm
-        #define SIGNAL_VM_PTR() tls_vm()
-#endif
-
-#ifdef FACTOR_REENTRANT_TLS
-/* uses thread local storage to obtain vm ptr */
-        #define PRIMITIVE_GETVM() tls_vm()
-        #define PRIMITIVE_OVERFLOW_GETVM() tls_vm()
-        #define VM_PTR tls_vm()
-        #define ASSERTVM()
-        #define SIGNAL_VM_PTR() tls_vm()
-#endif
-
-#ifdef FACTOR_REENTRANT
-        #define PRIMITIVE_GETVM() ((factor_vm*)myvm)
-        #define PRIMITIVE_OVERFLOW_GETVM() ((factor_vm*)myvm)
-        #define VM_PTR myvm
-        #define ASSERTVM()
-        #define SIGNAL_VM_PTR() tls_vm()
-#endif
-
 extern unordered_map<THREADHANDLE, factor_vm *> thread_vms;
 
 }