Commit Graph

16 Commits (github/freebsd-work)

Author SHA1 Message Date
Björn Lindqvist abbf8f8f1f VM: merging the profiling_sample and profiling_sample_count classes
This refactoring makes the code a bit simpler.
2017-06-25 01:17:12 +02:00
John Benediktsson 4fee8bd2cb vm: change where we set safepoints_fep to false to allow old Ctrl-C behavior. 2016-11-01 19:21:47 -07:00
Alexander Iljin 526a995d64 VM: implement a ctrl-break handler thread (#1573) 2016-11-01 16:53:00 -07:00
Björn Lindqvist b5c6658ae5 VM: removing the safepoint_state class
The code reads better if the safepoint_state methods and
attributes (sample_counts and safepoint_fep_p) are moved to the vm
class.
2016-08-15 15:16:41 +02:00
Björn Lindqvist 316b16f377 VM: instead of enqueue_safepoint() just call set_safepoint_guard() directly 2015-08-26 20:23:23 +02:00
Björn Lindqvist 39c888230a VM: new function set_safepoint_guard to replace the functions (un)guard_safepoint 2015-08-24 07:23:40 -07:00
Björn Lindqvist fb9fa12cdd VM: change the definition of entry_point in word and quotation from void* to cell
this gets rid of lots of redundant casts from void* to cell
2015-01-15 09:29:13 +00:00
Erik Charlebois ffe41b3d7f VM: Fixup cast formatting after clang-format
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
2013-05-13 14:59:24 -04:00
Erik Charlebois 2af4b6a7e6 VM: Refactor safepoints.cpp/hpp to Factor style 2013-05-12 13:24:47 -04:00
Joe Groff 0a1a252cdb vm: replace assert with FACTOR_ASSERT
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
2011-11-23 11:11:26 -08:00
Joe Groff 6c0ecf631a vm: charge samples collected in prolog to parent
Fixes #379
2011-11-23 11:11:26 -08:00
Joe Groff e24400679f vm: more defense against multi-faulting
* Clear faulting_p from a safepoint rather than inside general_error, because jumping into unwind-native-frames could blow up.
* Handle multiple faults from fatal_error by breakpointing. Is there anything else we can safely do at that point?
* Verify memory protection faults in the top half of the signal handlers because signal dispatch could fault. Treat memory faults during gc or fep as fatal errors.
* Add a function factor_vm::abort() that restores the default SIGABRT handler and ::abort()s. Use it from fatal_error() so we get useful context from gdb and so the user gets feedback from the system crash reporter that Factor blew up and didn't just disappear.
* In factorbug(), don't proceed with .s .r .c if it would be unsafe to do so.
* Don't pile on signals if we've already called fatal_error().
2011-11-12 13:02:57 -08:00
Joe Groff 90609cc5d8 vm: don't pass this to safepoint constructor
It's bad juju and MSVC calls us out on it.
2011-11-08 11:06:00 -08:00
Joe Groff 04c6b2c393 vm: write signals to pipe immediately
The whole point is to wake up the mx without waiting for the next safepoint derp
2011-11-08 08:42:47 -08:00
Joe Groff 18e01f7770 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.
2011-11-08 08:42:47 -08:00
Joe Groff 72d335f2b5 vm: write async signals to pipe for multiplexer
also factor out safepoint logic into its own file
2011-11-08 08:42:46 -08:00