Joe Groff [Mon, 24 Oct 2011 21:26:58 +0000 (14:26 -0700)]
vm: dispatch signal handlers through subprimitive
We also need to save C ABI volatile registers before calling the signal handler in order to be able to reliably resume. Add signal-handler and leaf-signal-handler subprimitives to preserve volatile registers before invoking the signal handler C function.
Joe Groff [Fri, 21 Oct 2011 17:53:44 +0000 (10:53 -0700)]
cpu.x86.(32,64).bootstrap: get rid of PUSH malarky
In the function prologue, move the stack pointer once after the stack frame is set up instead of PUSHing the stack frame piece by piece.
Joe Groff [Fri, 21 Oct 2011 06:21:36 +0000 (23:21 -0700)]
vm: allocate an extra canary page before callstack
This will let us safely unguard the callstack overflow guard page as a grace page so the callstack overflow handler can do its business without discarding frames.
Joe Groff [Fri, 21 Oct 2011 06:19:32 +0000 (23:19 -0700)]
vm: add factorbug command to throw exception
Also rename "q" to "c" because it "c"ontinues, remove the useless "im" command, and rename the less useful "t" to "trim" so we can use "t" to mean "throw"
Joe Groff [Fri, 21 Oct 2011 04:00:25 +0000 (21:00 -0700)]
vm: fep on SIGINT or SIGQUIT instead of exception
It's not robust currently to raise an exception because a lot of our code that isn't already written with exceptions in mind breaks. Also, a signal is likely to be received by an FFI callback installed on the IO multiplexer, which will cause Factor to die since the callback cannot handle the exception. We need a more robust solution to dealing with SIGINT.
Also lay some groundwork for counting profile samples and reporting non-interrupting asynchronous signals.
Joe Groff [Fri, 21 Oct 2011 03:55:55 +0000 (20:55 -0700)]
vm: clean up signal handler dispatch
Remove the weird and broken functions fix_callstack_top and scrub_return_address. Instead, simply decrement the SP and store the PC from the front end of the signal handler so that the back end can return back into the original context normally. Currently aborts for leaf procedure frames pending a more robust solution.
Joe Groff [Tue, 18 Oct 2011 00:11:12 +0000 (17:11 -0700)]
cpu.x86.assembler: add MOVABS instruction
MOVABS generates the one-byte opcode version of MOV eAX, [absolute] or MOV [absolute], eAX, which saves a byte per safepoint on x86-32.
Doug Coleman [Mon, 24 Oct 2011 00:05:22 +0000 (19:05 -0500)]
Factor out ``no-roots no-prefixes'' into its own word. Add load-root, load-from-root, vocabs-in-root and implement load in terms of load-from-root.
Add error checking for append-vocab-dir and (child-vocabs) in case someone tries to pass them the wrong parameters.
Rename: vocab-dir+ to append-vocab-dir
Document load-from-root and load-root
Doug Coleman [Wed, 19 Oct 2011 09:31:48 +0000 (02:31 -0700)]
When deleting a file, if it fails with "Access is denied" then set the file
attributes to normal and try again. Some files in the .git directory are set
to read-only, preventing the build machines from deleting old builds.
Joe Groff [Tue, 18 Oct 2011 22:13:02 +0000 (15:13 -0700)]
new vocab tools.annotations.assertions
Annotates unsafe words with assertions that their inputs and outputs are valid. Provide annotations for stream-read(-partial)-unsafe and (set-)nth-unsafe to start with.
Joe Groff [Tue, 18 Oct 2011 21:28:41 +0000 (14:28 -0700)]
io: error stream combinators
* with-error-stream(*)
* with-output+error-stream(*) -- sets output and error stream to same stream
* with-output>error -- sets output stream to error stream for scope
* with-input-output+error-streams(*) -- like with-streams, but sets output and error to same stream