From cdb6304fef1c3181100dbe3cf0116dcd3b8e6e71 Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Sun, 23 Aug 2009 19:40:59 +0100 Subject: [PATCH] Dev checkpoint --- basis/cpu/x86/32/32.factor | 2 ++ vm/code_heap.cpp | 2 +- vm/contexts.cpp | 6 ++++-- vm/contexts.hpp | 5 +++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index adddc4c5b2..fe365f2e50 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -257,11 +257,13 @@ M: x86.32 %callback-value ( ctype -- ) ESP 12 SUB ! Save top of data stack in non-volatile register %prepare-unbox + push-vm-ptr EAX PUSH ! Restore data/call/retain stacks "unnest_stacks" f %alien-invoke ! Place top of data stack in EAX EAX POP + temp-reg POP ! Restore C stack ESP 12 ADD ! Unbox EAX diff --git a/vm/code_heap.cpp b/vm/code_heap.cpp index 39f0dfd52a..d91e349db7 100755 --- a/vm/code_heap.cpp +++ b/vm/code_heap.cpp @@ -17,7 +17,7 @@ bool factorvm::in_code_heap_p(cell ptr) bool in_code_heap_p(cell ptr) { - return vm->in_code_heap_p(ptr); + return vm->in_code_heap_p(ptr); // used by os specific signal handlers } /* Compile a word definition with the non-optimizing compiler. Allocates memory */ diff --git a/vm/contexts.cpp b/vm/contexts.cpp index f5c63f1e7f..26197a4863 100644 --- a/vm/contexts.cpp +++ b/vm/contexts.cpp @@ -90,8 +90,9 @@ void factorvm::nest_stacks() reset_retainstack(); } -void nest_stacks() +void nest_stacks(factorvm *myvm) { + printf("PHIL nest_stacks %d %d\n",vm,myvm);fflush(stdout); return vm->nest_stacks(); } @@ -110,8 +111,9 @@ void factorvm::unnest_stacks() dealloc_context(old_stacks); } -void unnest_stacks() +void unnest_stacks(factorvm *myvm) { + printf("PHIL unnest_stacks %d %d\n",vm,myvm);fflush(stdout); return vm->unnest_stacks(); } diff --git a/vm/contexts.hpp b/vm/contexts.hpp index 17f8a7eb70..060b15fad7 100644 --- a/vm/contexts.hpp +++ b/vm/contexts.hpp @@ -50,8 +50,9 @@ PRIMITIVE(set_datastack); PRIMITIVE(set_retainstack); PRIMITIVE(check_datastack); -VM_C_API void nest_stacks(); -VM_C_API void unnest_stacks(); +struct factorvm; +VM_C_API void nest_stacks(factorvm *vm); +VM_C_API void unnest_stacks(factorvm *vm); } -- 2.34.1