Joe Groff
bb2df7da6b
vm: die if we fault in a fault
2011-11-02 13:23:16 -07:00
Joe Groff
fdeb6ddbaa
vm: quell MSVC warnings
2011-11-02 13:23:16 -07:00
Joe Groff
d7bc7ae4bf
vm: parameterize sampling rate
2011-11-02 13:23:15 -07:00
Joe Groff
66356c1d24
vm: better organize atomics and sample counter
2011-11-02 13:23:15 -07:00
Joe Groff
52bcbe55cf
vm: factor out sample counting code
2011-11-02 13:23:13 -07:00
Joe Groff
b89335df71
vm: only show factorbug help the first time
2011-11-02 13:23:13 -07:00
Joe Groff
c0e4458733
vm: fix build on windows
2011-11-02 13:23:12 -07:00
Joe Groff
bec71e9ae2
vm: sampling profiler timer for windows
...
Spawn a thread and have it spin on the performance counter, triggering safepoints on the main thread every sample time
2011-11-02 13:23:11 -07:00
Joe Groff
1c68bbf8a6
vm: count samples from foreign threads
...
On OS X it appears the mach exception thread and libdispatch queue threads occasionally get the SIGALRM from the itimer. Count those as foreign_thread_samples instead of letting the signal kill the process.
2011-11-02 13:23:10 -07:00
Joe Groff
1ab4871fcc
vm: add primitives to lift sample data to factor
2011-11-02 13:23:09 -07:00
Joe Groff
cb2e87ecde
vm: release memory used by sampler vectors
2011-11-02 13:23:08 -07:00
Joe Groff
1604c503ab
vm: don't allocate callstack samples on data heap
...
Invoking a GC during a safepoint has some complications, so stuff the callstack samples in a vector instead.
2011-11-02 13:23:07 -07:00
Joe Groff
2ddfdda7b5
vm: groundwork for sampling profiler
...
Set up the state necessary to collect samples. We still need to add GC support for walking the sample set, and the compiler needs to register GC roots before safepoints as well. We also need primitives to expose the data to Factor for reporting.
2011-11-02 13:23:06 -07:00
Joe Groff
12a4c7a538
vm: change "profiler" names to "counting_profiler"
2011-11-02 13:23:05 -07:00
Joe Groff
83569d3793
vm: give factorbug a help command
...
Also change the prompt to "> _" instead of "READY\n_" since it's not 1970 anymore
2011-10-27 21:18:23 -07:00
Joe Groff
09088ec3ce
cleanups from code review
2011-10-27 21:18:23 -07:00
Joe Groff
b1094e0e5f
vm: remove half-assed signal queueing scaffolding
...
Should implement it right later. See #297 .
2011-10-27 21:18:22 -07:00
Joe Groff
7e3944509a
vm: get CtrlHandler working on windows
2011-10-27 21:18:21 -07:00
Joe Groff
ad9b90f23b
vm: update windows for resumable signals
2011-10-27 21:18:21 -07:00
Joe Groff
e431cef96b
vm: move dispatch_signal_handler to cpu-x86.cpp
...
The new signal handler dispatch is logic is CISC-centric; defer fixing it until we find someone who cares
2011-10-27 21:18:20 -07:00
Joe Groff
1660bd5a19
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
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
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
675cd246ad
vm: fatal_error if VM-less thread gets a signal
2011-10-27 21:14:48 -07:00
Joe Groff
d103e6b57d
vm: remove unguard-safepoint primitive
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
John Benediktsson
58765c31d5
vm: remove math::bignum_producer.
2011-10-11 21:24:38 -07:00
John Benediktsson
da21f5ca61
io.binary: make le> and be> faster (20% and 75%, respectively).
...
Removed primitive byte-array>bignum and digit_stream_to_bignum from vm/.
2011-10-11 21:13:30 -07:00
Slava Pestov
20c6aaddec
Tease out symbol name and library in undefined_symbol() handler, for friendlier errors when calling an unresolved C function name. Fixes #93
2011-09-12 00:56:24 -07:00
Slava Pestov
22ad7c4fcd
vm: fix high_fragmentation_p assertion
2011-09-05 23:30:28 -07:00
Erik Charlebois
1ed2bc6231
32 and 64 bit Linux PPC support
2011-05-23 23:36:14 -04:00
Slava Pestov
b0b5f3ac97
Remove bignum>float VM primitive, and use bignum/f to implement >float on bignums instead, for a slight accuracy gain. Also, bignum/f now has a more efficient post-scaling algorithm to break the circular dependency on bignum>float
2010-11-24 22:41:15 -08:00
Slava Pestov
4877d32cb3
compiler: preliminary implementation of tracking derived pointers in GC maps
2010-09-27 20:12:44 -07:00
Slava Pestov
18e8c0af9c
vm: don't keep more than 10 unused contexts around to prevent address space wastage on low-budget operating systems like OpenBSD
2010-09-17 20:52:27 -07:00
Slava Pestov
05fc6ddad6
vm: a stack underflow inside a primitive could leave a data root in an uninitialized state; if allocating the thrown underflow error triggered a GC, the GC would visit a garbage pointer
2010-09-17 19:46:57 -07:00
Slava Pestov
09c74bda0b
vm: don't call nano_count() from the GC at all, unless GC event recording is on
2010-09-04 13:21:45 -07:00
Slava Pestov
0797875ef5
vm: fix crash when doing GC with profiling enabled
2010-09-03 21:54:40 -05:00
Slava Pestov
55ac874eb2
vm: Remove signal_callstack_top nonsense
2010-09-02 22:57:17 -05:00
Slava Pestov
6617eca683
Fix three problems discovered by running math.floats.env tests in a loop:
...
- Crash if allocating error triggers a GC from a signal/SEH handler
- Crash if GC runs with floating point traps enabled on Windows
- Floating point traps didn't prettyprint properly
2010-09-02 22:57:14 -05:00
Slava Pestov
f3dfae04ba
compiler: now that FFI has been deconcatenatized, we no longer need the special ##unary-float-function and ##binary-float-function fastpaths
2010-08-13 23:59:19 -07:00
Slava Pestov
0abdfbfc1b
compiler.cfg: open-code parameter boxing and unboxing for certain C types
2010-07-19 10:25:13 -04:00
Doug Coleman
97c3450427
Remove system_micros from vm, implement gmt hook on windows
2010-06-16 23:39:16 -05:00
Slava Pestov
5e39764ccd
vm: have to be extra careful when messing with return addresses
2010-06-13 18:12:57 -04:00
Slava Pestov
d91524b98d
vm: context switching needs to scrub the return address
2010-06-12 19:54:31 -04:00
Slava Pestov
a08295d9b7
GC maps for more compact inline GC checks
2010-06-11 20:06:00 -04:00
Slava Pestov
35bd2bca06
FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing
2010-05-16 03:43:23 -04:00