removed some vm-> forwarding functions

db4
Phil Dawes 2009-08-23 21:19:35 +01:00
parent 2f3cd4d23d
commit 700e03a6a6
6 changed files with 4 additions and 19 deletions

View File

@ -93,12 +93,6 @@ void *factorvm::alien_pointer()
return unbox_alien() + offset;
}
void *alien_pointer()
{
return vm->alien_pointer();
}
/* define words to read/write values at an alien address */
#define DEFINE_ALIEN_ACCESSOR(name,type,boxer,to) \
PRIMITIVE(alien_##name) \
@ -232,7 +226,7 @@ char *factorvm::unbox_alien()
VM_C_API char *unbox_alien()
{
printf("*PHIL unbox_alien\n");fflush(stdout);
printf("PHIL unbox_alien\n");fflush(stdout);
return vm->unbox_alien();
}

View File

@ -9,17 +9,11 @@ void factorvm::init_code_heap(cell size)
new_heap(&code,size);
}
bool factorvm::in_code_heap_p(cell ptr)
{
return (ptr >= code.seg->start && ptr <= code.seg->end);
}
bool in_code_heap_p(cell 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 */
void factorvm::jit_compile_word(cell word_, cell def_, bool relocate)
{

View File

@ -1,8 +1,5 @@
namespace factor
{
bool in_code_heap_p(cell ptr); // Used by platform specific code
struct factorvm;
typedef void (*code_heap_iterator)(code_block *compiled,factorvm *myvm);

View File

@ -41,7 +41,7 @@ static void call_fault_handler(
a divide by zero or stack underflow in the listener */
/* Are we in compiled Factor code? Then use the current stack pointer */
if(in_code_heap_p(MACH_PROGRAM_COUNTER(thread_state)))
if(vm->in_code_heap_p(MACH_PROGRAM_COUNTER(thread_state)))
signal_callstack_top = (stack_frame *)MACH_STACK_POINTER(thread_state);
/* Are we in C? Then use the saved callstack top */
else

View File

@ -107,7 +107,7 @@ static stack_frame *uap_stack_pointer(void *uap)
delivered during stack frame setup/teardown or while transitioning
from Factor to C is a sign of things seriously gone wrong, not just
a divide by zero or stack underflow in the listener */
if(in_code_heap_p(UAP_PROGRAM_COUNTER(uap)))
if(vm->in_code_heap_p(UAP_PROGRAM_COUNTER(uap)))
{
stack_frame *ptr = (stack_frame *)ucontext_stack_pointer(uap);
if(!ptr)

View File

@ -21,7 +21,7 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord;
CONTEXT *c = (CONTEXT*)pe->ContextRecord;
if(in_code_heap_p(c->EIP))
if(vm->in_code_heap_p(c->EIP))
signal_callstack_top = (stack_frame *)c->ESP;
else
signal_callstack_top = NULL;