From f9f1031dd87ead215cf1448ffd1887977dcc6cda Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Thu, 20 Aug 2009 19:20:48 +0100 Subject: [PATCH] moved stack_chain into vm struct --- basis/cpu/x86/x86.factor | 4 ++-- vm/contexts.cpp | 2 -- vm/contexts.hpp | 1 - vm/cpu-x86.64.S | 2 +- vm/vm.hpp | 3 +++ 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/cpu/x86/x86.factor b/basis/cpu/x86/x86.factor index da391f6320..798b67bc1a 100644 --- a/basis/cpu/x86/x86.factor +++ b/basis/cpu/x86/x86.factor @@ -612,7 +612,7 @@ M:: x86 %call-gc ( gc-root-count -- ) ! Call GC "inline_gc" f %vm-invoke ; -M: x86 %alien-global +M: x86 %alien-global ( dst symbol library -- ) [ 0 MOV ] 2dip rc-absolute-cell rel-dlsym ; M: x86 %epilogue ( n -- ) cell - incr-stack-reg ; @@ -742,7 +742,7 @@ M:: x86 %save-context ( temp1 temp2 callback-allowed? -- ) #! Save Factor stack pointers in case the C code calls a #! callback which does a GC, which must reliably trace #! all roots. - temp1 "stack_chain" f %alien-global + temp1 0 MOV rc-absolute-cell rt-vm rel-fixup ! stack-chain is first item in vm struct. TODO: make vm C-STRUCT temp1 temp1 [] MOV temp2 stack-reg cell neg [+] LEA temp1 [] temp2 MOV diff --git a/vm/contexts.cpp b/vm/contexts.cpp index 3d627ab050..f5c63f1e7f 100644 --- a/vm/contexts.cpp +++ b/vm/contexts.cpp @@ -1,7 +1,5 @@ #include "master.hpp" -factor::context *stack_chain; - namespace factor { diff --git a/vm/contexts.hpp b/vm/contexts.hpp index 905d3d5b49..17f8a7eb70 100644 --- a/vm/contexts.hpp +++ b/vm/contexts.hpp @@ -55,4 +55,3 @@ VM_C_API void unnest_stacks(); } -VM_C_API factor::context *stack_chain; diff --git a/vm/cpu-x86.64.S b/vm/cpu-x86.64.S index 606c81c582..98addeb80d 100644 --- a/vm/cpu-x86.64.S +++ b/vm/cpu-x86.64.S @@ -88,7 +88,7 @@ DEF(void,primitive_inline_cache_miss_tail,(void)): add $STACK_PADDING,%rsp jmp *%rax -<<<<<<< HEAD + DEF(void,get_sse_env,(void*)): stmxcsr (%rdi) ret diff --git a/vm/vm.hpp b/vm/vm.hpp index 9af0c5c8f9..40be36b249 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -3,6 +3,9 @@ namespace factor struct factorvm { + factor::context *stack_chain; + + // segments inline cell align_page(cell a);