diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 04165ca73a..ef3aaf67a9 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,5 +1,7 @@ + 0.84: += bug fixes: + - fix contribs: boids, automata - sometimes darcs get fails with the httpd - gdb triggers 'mutliple i/o ops on port' error @@ -8,16 +10,18 @@ - editor: - better listener multi-line expression handling - history doesn't work in a good way if you ^K the input -- graphical module manager tool - services do not launch if factor not running - roundoff is still not quite right with tracks - fix top level window positioning - nasty inference regressions - [ [ dup call ] dup call ] infer hangs - the invalid recursion form case needs to be fixed, for inlines too + += features: + +- graphical module manager tool - instead of decompiling words, add them to a 'recompile' set; compiler treats words in the recompile set as if they were not compiled -- mach_signal: fault address reporting is not reliable - see if alien calls can be made faster - faster sequence= for UI - constant branch folding @@ -29,6 +33,7 @@ + ui: +- better doc for accumulate, link from tree - we have trouble drawing rectangles - the UI listener has a shitty design. perhaps it should not call out to the real listener. diff --git a/vm/mach_signal.c b/vm/mach_signal.c index 13d0da5b94..37d1a47716 100644 --- a/vm/mach_signal.c +++ b/vm/mach_signal.c @@ -22,11 +22,11 @@ static mach_port_t our_exception_port; /* Communication area for the exception state and thread state. */ static SIGSEGV_THREAD_STATE_TYPE save_thread_state; -/* A handler that is called in the faulting thread. It terminates the thread. */ +/* A handler that is called in the faulting thread. */ static void -terminating_handler () +terminating_handler (void *fault_addr) { - raise (SIGSEGV); + memory_protection_error(fault_addr,SIGSEGV); abort (); } @@ -72,6 +72,7 @@ catch_exception_raise (mach_port_t exception_port, save_thread_state = thread_state; SIGSEGV_PROGRAM_COUNTER (thread_state) = (unsigned long) terminating_handler; + pass_arg0(&thread_state,SIGSEGV_EXC_STATE_FAULT(exc_state)); SIGSEGV_STACK_POINTER (thread_state) = fix_stack_ptr(sp); /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_set_state.html. */ diff --git a/vm/os-macosx-ppc.h b/vm/os-macosx-ppc.h index c3e5556d09..1ec8a2f1f0 100644 --- a/vm/os-macosx-ppc.h +++ b/vm/os-macosx-ppc.h @@ -1,13 +1,20 @@ #define SIGSEGV_EXC_STATE_TYPE ppc_exception_state_t #define SIGSEGV_EXC_STATE_FLAVOR PPC_EXCEPTION_STATE #define SIGSEGV_EXC_STATE_COUNT PPC_EXCEPTION_STATE_COUNT +#define SIGSEGV_EXC_STATE_FAULT(exc_state) (exc_state).dar #define SIGSEGV_THREAD_STATE_TYPE ppc_thread_state_t #define SIGSEGV_THREAD_STATE_FLAVOR PPC_THREAD_STATE #define SIGSEGV_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT #define SIGSEGV_STACK_POINTER(thr_state) (thr_state).r1 +#define SIGSEGV_THREAD_STATE_ARG(thr_state) (thr_state).r3 #define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).srr0 INLINE unsigned long fix_stack_ptr(unsigned long sp) { return sp; } + +INLINE void pass_arg0(SIGSEGV_THREAD_STATE_TYPE *thr_state, CELL arg) +{ + SIGSEGV_THREAD_STATE_ARG(*thr_state) = arg; +} diff --git a/vm/os-macosx-x86.h b/vm/os-macosx-x86.h index 98de91dc4f..0a792a3957 100644 --- a/vm/os-macosx-x86.h +++ b/vm/os-macosx-x86.h @@ -1,15 +1,23 @@ #define SIGSEGV_EXC_STATE_TYPE i386_exception_state_t #define SIGSEGV_EXC_STATE_FLAVOR i386_EXCEPTION_STATE #define SIGSEGV_EXC_STATE_COUNT i386_EXCEPTION_STATE_COUNT +#define SIGSEGV_EXC_STATE_FAULT(exc_state) (exc_state).dar #define SIGSEGV_THREAD_STATE_TYPE i386_thread_state_t #define SIGSEGV_THREAD_STATE_FLAVOR i386_THREAD_STATE #define SIGSEGV_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT #define SIGSEGV_STACK_POINTER(thr_state) (thr_state).esp #define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).eip +/* Adjust stack pointer so we can push an arg */ INLINE unsigned long fix_stack_ptr(unsigned long sp) { if ((sp & 0xf) != 0) sp -= (sp & 0xf); - sp -= 4; + sp -= 8; return sp; } + +INLINE void pass_arg0(SIGSEGV_THREAD_STATE_TYPE *thr_state, CELL arg) +{ + *SIGSEGV_STACK_POINTER(*thread_state) = arg; + SIGSEGV_STACK_POINTER(*thread_state) -= CELLS; +}