Joe Groff [Fri, 11 Nov 2011 00:00:47 +0000 (16:00 -0800)]
vm: strip out call-counting profiler
This makes the separate "code" and "entry_point" fields in word and quotation redundant, so also remove them to reclaim an additional cell per word and quotation object, which should help with #318.
Joe Groff [Thu, 10 Nov 2011 23:14:03 +0000 (15:14 -0800)]
init signals or console after stage2 init
A signal during early bootstrap is certainly an error, and the environment isn't there yet for Factor's signal handlers to work, so it makes no sense to install Factor's signal handlers beforehand. They'll just crash.
Joe Groff [Thu, 10 Nov 2011 21:46:44 +0000 (13:46 -0800)]
vm: don't SIGQUIT on unix or Ctrl-Break on windows
This gives us an escape hatch for when things go way south and ^C can't be handled. Also unmask SIGQUIT and SIGTERM from the stdin_loop thread so the thread doesn't keep the process alive after those signals.
Joe Groff [Thu, 10 Nov 2011 01:21:44 +0000 (17:21 -0800)]
io: more hot-rodding for #376
* Change the interface of read-into to return a slice and an eof boolean separately so the compiler can optimize the slice.
* Add an each-stream-block-slice combinator that behaves like each-block but reuses a preallocated buffer for every iteration.
* Pull some strings in the stream-read-into implementation to further improve type propagation and bounds check elimination.
Joe Groff [Wed, 9 Nov 2011 22:43:39 +0000 (14:43 -0800)]
io.files: add file-reader, file-writer mixins
This lets us do some trickery so that the stream-element-type propagates from <file-reader>/<file-writer>. For #376.
Joe Groff [Wed, 9 Nov 2011 22:29:12 +0000 (14:29 -0800)]
io:read: don't resize output buffer if unnecessary
Even with a short-circuit test in the VM primitives, resize still has an overly high runtime cost in tight loops. For #376.
Joe Groff [Wed, 9 Nov 2011 06:07:22 +0000 (22:07 -0800)]
vm: make signal pipe nonblocking
On the off chance the Factor end of the signal handler mechanism isn't listening, we don't want to tie up the VM because the pipe's buffer got full.
Joe Groff [Tue, 8 Nov 2011 22:11:53 +0000 (14:11 -0800)]
tools.profiler.sampling: change some names around
Rename the versions of top-down etc. that take sample data to "top-down*" (from "(top-down)") so they don't look so scary to use. Change "get-raw-profile-data" to "most-recent-profile-data".
Joe Groff [Tue, 8 Nov 2011 05:12:11 +0000 (21:12 -0800)]
vm: interrupt stdin_loop when entering fep
The stdin_loop thread will keep trying to consume input unless we stop it by sending it a signal. Use SIGUSR2 to stop the read syscall and a mutex to hold up the loop while the fep is active.
Joe Groff [Mon, 7 Nov 2011 22:05:31 +0000 (14:05 -0800)]
vm: enqueue signals for FEP signals too
Although SIGINT still can't interrupt the current Factor thread in a sane way, this will at least wake up the run loop when waiting for input and fix #348 when implemented at the application level.
Joe Groff [Tue, 8 Nov 2011 01:58:53 +0000 (17:58 -0800)]
vm: switch atomic::add to atomic::fetch_add
Win32 only provides fetch-and-add, not add-and-fetch, and we don't really care. Rename the functions so the order of operations is clear.
Doug Coleman [Mon, 7 Nov 2011 03:25:53 +0000 (19:25 -0800)]
math.functions: flushable and foldable don't do anything on inline words because flushable and foldable work on call sites (#call nodes), and inlined words are inlined into another word's call site; they don't generate their own #call node.
Joe Groff [Mon, 7 Nov 2011 02:57:12 +0000 (18:57 -0800)]
tools.deploy.backend: fix vocab manifest parse
We were absent-mindedly passing the VOCABS: line off as a vocab name itself. vocabs.loader doesn't put up with that anymore.
Joe Groff [Fri, 4 Nov 2011 17:01:39 +0000 (10:01 -0700)]
cpu.x86.64.bootstrap: save all the regs on signal
Appears to fix another sporadic crash from mason on x86-64. There's no reason to cut corners here, really.
Joe Groff [Fri, 4 Nov 2011 03:19:01 +0000 (20:19 -0700)]
cpu.x86.bootstrap: don't safepoint in a safepoint
Safepointing in the signal-handler primitive causes a crash if the safepoint is guarded and the signal being handled was raised by a safepoint. Put our own RET in the subprimitive to bail out before the standard epilog gets written out. This tentatively appears to fix #349.
Doug Coleman [Thu, 3 Nov 2011 18:34:41 +0000 (11:34 -0700)]
Make the require-hook throw an error if the vocabulary does not exist in the dictionary or on disk. Move require docs to vocabs. Add unit tests for require. Fixes #339.
Joe Groff [Thu, 3 Nov 2011 05:15:52 +0000 (22:15 -0700)]
vm: reserve some more special-objects
Need a jit-safepoint object to deal with #332, and ffi-signal-handler words for immediate signal handling during FFI calls