Commit Graph

22742 Commits (a6b80f3efa3389cec1e726a3f98ddfa1f13d2746)

Author SHA1 Message Date
Joe Groff a6b80f3efa vm: code_block_for_address method -> code_heap 2011-10-27 21:18:20 -07:00
Joe Groff 03ebb91170 vm: remove signal_from_leaf flag
Now that the resuming from the signal handler works within leaf procedures, the flag is no longer necessary.
2011-10-27 21:18:20 -07:00
Joe Groff 11ffea55fc vm: sniff leaf words walking code heap, not data 2011-10-27 21:18:19 -07:00
Joe Groff 126bf22c16 vm: include quots and profile stubs in leaf search 2011-10-27 21:18:19 -07:00
Joe Groff ff2d480d98 cpu.x86.32: update for resumable signal handlers 2011-10-27 21:18:19 -07:00
Joe Groff d6eae2f42d vm: suppress signal-handler stack frame generation
This is a hack; see #295
2011-10-27 21:18:19 -07:00
Joe Groff 7bd7d0234d vm: turns out adding and subtracting are different 2011-10-27 21:18:19 -07:00
Joe Groff f284ac2b48 vm: fix foreign segfaults and callstack overflows 2011-10-27 21:18:18 -07:00
Joe Groff 402e1155a5 vm: resumably handle signals from leaf procedures 2011-10-27 21:18:18 -07:00
Joe Groff 1386212d23 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 dca0fd3487 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 68518e741e 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 1a673e30f5 vm: comments should be in English 2011-10-27 21:14:50 -07:00
Joe Groff c3f007ce0a 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 b0b0905460 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 a374c2da05 vm: sketchy signal dispatch from leaf procs 2011-10-27 21:14:49 -07:00
Joe Groff 6e4117035e vm: factor out dispatch_signal_handler logic 2011-10-27 21:14:49 -07:00
Joe Groff dc42365007 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 1dc31d133b 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 92a5b7c300 vm: don't mix iostream and stdio 2011-10-27 21:14:48 -07:00
Joe Groff c06be95816 compiler: no spurious safepoint at start of loops 2011-10-27 21:14:48 -07:00
Joe Groff 3726f61c70 vm: fatal_error if VM-less thread gets a signal 2011-10-27 21:14:48 -07:00
Joe Groff 41c36752fc compiler.cfg.tco: clean up commented-out old code 2011-10-27 21:14:47 -07:00
Joe Groff 7f3d70f97f vm: fix windows compile errors 2011-10-27 21:14:47 -07:00
Joe Groff d6a06cf5dc vm: remove unguard-safepoint primitive 2011-10-27 21:14:47 -07:00
Joe Groff 552711e903 vm: block all signals from unix stdin_loop thread 2011-10-27 21:14:47 -07:00
Joe Groff 9865417149 vm: SetConsoleCtrlHandler on windows 2011-10-27 21:14:47 -07:00
Joe Groff b3e5f75c9e 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 6f75e84d93 compiler.cfg.tco: teach TCO about safepoints 2011-10-27 21:14:46 -07:00
Joe Groff e449fef4e3 compiler.cfg.builder: safepoint loops and epilogs 2011-10-27 21:14:46 -07:00
Joe Groff 0c022f2454 compiler: add ##safepoint IR insn 2011-10-27 21:14:46 -07:00
Joe Groff ae1a903c4e 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 9b575730bb vm: add RT_SAFEPOINT to number_of_parameters() 2011-10-27 21:14:45 -07:00
Joe Groff 4be5eadb34 cpu.x86.bootstrap: add safepoint to jit-epilog 2011-10-27 21:14:45 -07:00
Joe Groff 98fa51f0e0 compiler: rt-safepoint and rel-safepoint words 2011-10-27 21:14:45 -07:00
Joe Groff e1465308cd vm: add RT_SAFEPOINT relocation type 2011-10-27 21:14:44 -07:00
Joe Groff 99804d5e3f vm: code_heap::(un)guard_safepoint methods 2011-10-27 21:14:44 -07:00
Joe Groff 4c8dec1e98 vm: take a page from code_heap for safepoints 2011-10-27 21:14:44 -07:00
John Benediktsson a8c481bee3 synth: adding some tests. 2011-10-27 09:47:36 -07:00
John Benediktsson a789712f48 synth: fix code that depended on iterable numbers. 2011-10-26 15:14:39 -07:00
Doug Coleman 7b6f27eda6 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 1882e3de3e Use dip instead of swap swap for making file streams 2011-10-26 11:48:26 -07:00
John Benediktsson 140b372218 Merge remote-tracking branch 'upstream/master' 2011-10-26 10:07:21 -07:00
John Benediktsson f896a4d4ae brainfuck: minor cleanup. 2011-10-26 10:07:04 -07:00
Doug Coleman 80a1a68e0f Fix error reporting for load, reported by Recursed 2011-10-25 14:54:23 -07:00
Doug Coleman 4ebe5218c7 Update Windows for word renames, fix lint errors 2011-10-24 21:50:02 -07:00
Doug Coleman 51c033a1f6 Fix all failures in the linux64 build email 2011-10-24 19:33:09 -07:00
Doug Coleman 763d9a3f7d Missed yet more renames 2011-10-24 17:00:09 -07:00
Doug Coleman df64529fb5 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 d5dc5cfa2c Fix 32bit platform bootstrap 2011-10-24 16:24:01 -07:00