Joe Groff
a5da58bb97
vm: fix foreign segfaults and callstack overflows
2011-10-27 21:18:18 -07:00
Joe Groff
1eddaf34f1
vm: resumably handle signals from leaf procedures
2011-10-27 21:18:18 -07:00
Joe Groff
cb6f175ef8
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.
2011-10-27 21:18:18 -07:00
Joe Groff
011ce33068
vm: Revert extra canary page before callstack
...
This reverts commit 7d5c8d6990385b94569116a23163d7e75ae21f49. We pretty much can't avoid unwinding frames without some more drastic redesign.
2011-10-27 21:14:50 -07:00
Joe Groff
d41c3f2709
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.
2011-10-27 21:14:50 -07:00
Joe Groff
50ae01e659
vm: comments should be in English
2011-10-27 21:14:50 -07:00
Joe Groff
ed72d57c1a
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.
2011-10-27 21:14:49 -07:00
Joe Groff
64af6a1492
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"
2011-10-27 21:14:49 -07:00
Joe Groff
f788bc954c
vm: sketchy signal dispatch from leaf procs
2011-10-27 21:14:49 -07:00
Joe Groff
f759575ddd
vm: factor out dispatch_signal_handler logic
2011-10-27 21:14:49 -07:00
Joe Groff
91d8bcd4f8
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.
2011-10-27 21:14:49 -07:00
Joe Groff
01b782e6c4
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.
2011-10-27 21:14:48 -07:00
Joe Groff
1467015a27
vm: don't mix iostream and stdio
2011-10-27 21:14:48 -07:00
Joe Groff
5fa890cb20
compiler: no spurious safepoint at start of loops
2011-10-27 21:14:48 -07:00
Joe Groff
675cd246ad
vm: fatal_error if VM-less thread gets a signal
2011-10-27 21:14:48 -07:00
Joe Groff
f297b39c60
compiler.cfg.tco: clean up commented-out old code
2011-10-27 21:14:47 -07:00
Joe Groff
29dad5c168
vm: fix windows compile errors
2011-10-27 21:14:47 -07:00
Joe Groff
d103e6b57d
vm: remove unguard-safepoint primitive
2011-10-27 21:14:47 -07:00
Joe Groff
6f831c4f95
vm: block all signals from unix stdin_loop thread
2011-10-27 21:14:47 -07:00
Joe Groff
5b4a95a6a0
vm: SetConsoleCtrlHandler on windows
2011-10-27 21:14:47 -07:00
Joe Groff
e9309a425a
vm: handle async signals at safepoints on unix
...
Factor now supports the new 4.0BSD feature of "signals".
2011-10-27 21:14:46 -07:00
Joe Groff
4a8e1d5f0e
compiler.cfg.tco: teach TCO about safepoints
2011-10-27 21:14:46 -07:00
Joe Groff
b0bccf49d1
compiler.cfg.builder: safepoint loops and epilogs
2011-10-27 21:14:46 -07:00
Joe Groff
cf45e0d581
compiler: add ##safepoint IR insn
2011-10-27 21:14:46 -07:00
Joe Groff
6e237abb5e
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.
2011-10-27 21:14:45 -07:00
Joe Groff
72c35ffeee
vm: add RT_SAFEPOINT to number_of_parameters()
2011-10-27 21:14:45 -07:00
Joe Groff
09d0fdaf8d
cpu.x86.bootstrap: add safepoint to jit-epilog
2011-10-27 21:14:45 -07:00
Joe Groff
ac3054d1e6
compiler: rt-safepoint and rel-safepoint words
2011-10-27 21:14:45 -07:00
Joe Groff
5b8bc33311
vm: add RT_SAFEPOINT relocation type
2011-10-27 21:14:44 -07:00
Joe Groff
e6f65d81e4
vm: code_heap::(un)guard_safepoint methods
2011-10-27 21:14:44 -07:00
Joe Groff
d2199b5b21
vm: take a page from code_heap for safepoints
2011-10-27 21:14:44 -07:00
John Benediktsson
f49c71994d
synth: adding some tests.
2011-10-27 09:47:36 -07:00
John Benediktsson
61dd542815
synth: fix code that depended on iterable numbers.
2011-10-26 15:14:39 -07:00
Doug Coleman
313a8dbe88
Add a lint check for swap .. swap that can be replaced by dip. Clean up the cases it finds.
2011-10-26 13:01:04 -07:00
Doug Coleman
1641adc511
Use dip instead of swap swap for making file streams
2011-10-26 11:48:26 -07:00
John Benediktsson
ba6a147185
Merge remote-tracking branch 'upstream/master'
2011-10-26 10:07:21 -07:00
John Benediktsson
8d4f11bef9
brainfuck: minor cleanup.
2011-10-26 10:07:04 -07:00
Doug Coleman
9df6d05a4e
Fix error reporting for load, reported by Recursed
2011-10-25 14:54:23 -07:00
Doug Coleman
b5b27676c4
Update Windows for word renames, fix lint errors
2011-10-24 21:50:02 -07:00
Doug Coleman
f05e33fa37
Fix all failures in the linux64 build email
2011-10-24 19:33:09 -07:00
Doug Coleman
55d6dc14b0
Missed yet more renames
2011-10-24 17:00:09 -07:00
Doug Coleman
b61f9f6903
Forget some classes after unit tests so that running "classes" test succeeds multiple times in a row
2011-10-24 16:59:46 -07:00
Doug Coleman
cb41cc99d8
Fix 32bit platform bootstrap
2011-10-24 16:24:01 -07:00
John Benediktsson
7b177d6237
vocabs.loader: actually use the root cache.
2011-10-24 16:19:59 -07:00
Doug Coleman
14a2511d57
Found a few more places to use lookup-c-type
2011-10-24 15:58:40 -07:00
John Benediktsson
5dde0a5057
windows.directx: add platforms.txt.
2011-10-24 15:47:06 -07:00
Doug Coleman
7bfbe17861
Rename c-type to lookup-c-type. Fixes #230 .
2011-10-24 14:37:24 -07:00
Doug Coleman
96da8df16e
Rename class to class-of
2011-10-24 06:47:42 -05:00
Doug Coleman
a7f6982354
Rename vocab to lookup-vocab
2011-10-24 06:42:54 -05:00
Doug Coleman
3c99d38a7f
Remove docs for removed word
2011-10-24 00:57:14 -05:00