Joe Groff [Fri, 18 Nov 2011 04:42:30 +0000 (20:42 -0800)]
vm: replace assert with FACTOR_ASSERT
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
Joe Groff [Thu, 17 Nov 2011 22:29:01 +0000 (14:29 -0800)]
vm: keep a set of all code_blocks in the code_heap
This way looking up code blocks by return address is an O(log n) set lookup rather than an O(n) linear scan.
Doug Coleman [Wed, 23 Nov 2011 09:19:09 +0000 (01:19 -0800)]
classes.maybe: make maybe's slot type a classoid so you can do maybe: union{ }. Fix prettyprinting of anonymous-union/intersection. Fixes #427, fixes #428.
Doug Coleman [Tue, 22 Nov 2011 22:47:52 +0000 (14:47 -0800)]
classes: Make methods dispatch on maybes. Fix a couple bugs in the implementation of maybe. classoid? is now a dumb test if an object could be a well-formed classoid; valid-classoid? tests for well-formedness. Move maybe tests. Make pprint* work better on methods.
Doug Coleman [Tue, 22 Nov 2011 07:00:52 +0000 (23:00 -0800)]
classes.union: Define a maybe: word that makes a tuple that acts as an anonymous union for a type and f. Updated all the places we define UNION: ?foo foo POSTPONE: f ;. Fixes #416 and lots of headaches.
Doug Coleman [Tue, 22 Nov 2011 00:38:16 +0000 (16:38 -0800)]
cocoa.messages: Apply mrjbq's patch to show the name of the cooca function in sender stubs. rename 'method' in stack effects to 'signature' since we are passing an array with the return value and arguments, not the method.
Joe Groff [Wed, 16 Nov 2011 04:04:44 +0000 (20:04 -0800)]
vocabs.refresh.monitor: handle symlink paths
On macosx, fsevents always provides the true path for changed files, even if the monitored path includes symlinks. This screws things up if a symlinked path is used as a vocab root. Fixes #404.
Doug Coleman [Wed, 16 Nov 2011 00:30:20 +0000 (16:30 -0800)]
dlists: make a dlist-link tuple so you can "be the node" by subclassing it. this allows you go put a type on the obj>> slot. ensure that dlist nodes are returned with prev/next pointers set to f so they can be reused. dlist-filter used to work destructively on the dlist, make a new dlist instead because the combinator relied on using prev/next of deleted nodes.
Joe Groff [Mon, 14 Nov 2011 00:09:30 +0000 (16:09 -0800)]
math.vectors.simd: don't try distance on int types
"v- norm" doesn't work right for uint-4s because of underflow, but who's going to call "distance" on a uint vector?
Joe Groff [Sun, 13 Nov 2011 08:02:40 +0000 (00:02 -0800)]
math.vectors.simd: add vcount to the tests
Also add a base case to (approx=) for integer returns. vcount returns an integer even for float vector inputs, but the test machinery isn't smart enough to figure that out and uses (approx=) on the outputs anyway.
Joe Groff [Fri, 11 Nov 2011 21:29:46 +0000 (13:29 -0800)]
vm: more defense against multi-faulting
* Clear faulting_p from a safepoint rather than inside general_error, because jumping into unwind-native-frames could blow up.
* Handle multiple faults from fatal_error by breakpointing. Is there anything else we can safely do at that point?
* Verify memory protection faults in the top half of the signal handlers because signal dispatch could fault. Treat memory faults during gc or fep as fatal errors.
* Add a function factor_vm::abort() that restores the default SIGABRT handler and ::abort()s. Use it from fatal_error() so we get useful context from gdb and so the user gets feedback from the system crash reporter that Factor blew up and didn't just disappear.
* In factorbug(), don't proceed with .s .r .c if it would be unsafe to do so.
* Don't pile on signals if we've already called fatal_error().