Commit Graph

85 Commits (2a8af325347d5e90ce874f706f5746cd0ddaac9b)

Author SHA1 Message Date
Joe Groff a39b976bc1 vm: flush after print_obj so it's usable from gdb 2011-12-21 13:25:28 -08:00
Joe Groff cd9b3f26ee vm: load mega cache object before popping frame
Fixes #457 harder
2011-12-20 14:38:01 -08:00
Joe Groff 9df2c107dc vm: remove _reversed from callstack iterator names
Now that they're the only game in town we can give them the short names
2011-12-14 09:56:49 -08:00
Joe Groff 841600fc6e vm: stage code block map fixup properly for GC
Don't update the map until the very last thing, and pass untranslated addresses to the iterator functors. Somewhat complicated by the fact that, for startup_fixup, the map is initialized with fixed-up values, so the fixup functor needs a flag indicating whether it operates with a fixed or unfixed code heap map.
2011-12-14 09:56:48 -08:00
Joe Groff faa9b4ea3f vm: callstack_reversed in code_block_visitor 2011-12-14 09:56:48 -08:00
Joe Groff 00967b4931 vm: iterate_callstack_reversed in slot_visitor 2011-12-14 09:56:47 -08:00
Joe Groff 41f3190349 vm: reversed callstack iteration 2011-12-14 09:56:47 -08:00
Joe Groff 5926257d1e WIP verify_callstack function
dumps callstack in reverse order so i can visually inspect that it matches the old forward walking logic
2011-12-14 09:56:47 -08:00
Joe Groff 14e0c9f482 vm: pack frame size into code block header bits 2011-12-14 09:56:45 -08:00
Joe Groff 9186a1bdf3 vm: store stack frame size in code blocks
Change modify-code-heap primitive so it takes a sixth element in each array for the frame size.
2011-12-14 09:56:45 -08:00
Joe Groff f51e262e44 vm: add compact-gc command to factorbug 2011-12-12 19:03:42 -08:00
Joe Groff 00f00663ad 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 ab9088e7ba vm: disable SIGINT handler while in factorbug
Fixes #410
2011-11-15 18:50:42 -08:00
Joe Groff beb0f48da9 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 c5d7ce0282 vm: "edges" command for factorbug 2011-11-11 10:12:36 -08:00
Joe Groff 7a7b19a8fd vm: more commentary on lock_console() stuff 2011-11-08 08:52:52 -08:00
Joe Groff 75f9904c40 vm: interrupt stdin_loop when entering fep
The stdin_loop thread will keep trying to consume input unless we stop it by sending it a signal. Use SIGUSR2 to stop the read syscall and a mutex to hold up the loop while the fep is active.
2011-11-08 08:42:48 -08:00
Joe Groff 04a3c88227 vm: readable feps for more types 2011-11-06 20:26:52 -08:00
Joe Groff dadc8a3baa vm: print type names instead of numbers in fep 2011-11-06 20:26:51 -08:00
Joe Groff b89335df71 vm: only show factorbug help the first time 2011-11-02 13:23:13 -07:00
Joe Groff 6d922c70a9 get sampler working under windows 2011-11-02 13:23:12 -07:00
Joe Groff c6da65cba2 vm: only show factorbug basic commands at first
"help" brings up the entire command list.
2011-11-02 13:23:07 -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 3b04f3b270 vm: add "gc" command to factorbug 2011-10-27 21:18:22 -07:00
Joe Groff ef603216ad vm: some typos in debug.cpp 2011-10-27 21:18:21 -07:00
Joe Groff 3c947d0019 vm: change factorbug "q" to quit process
Also change the docs around so the useful commands are all listed under "Basic commands", and rename the more arcane "s" and "r" dumps to "ds" and "dr".
2011-10-27 21:18:20 -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 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
Slava Pestov 858c4c6343 vm: fep g command prints addresses in h hex for readability 2010-09-09 20:36:50 -07:00
Joe Groff 56702b868c vm: remove some mixed use of stdio/iostream. when monotonic timer decreases, log old and new values 2010-08-01 16:14:20 -07:00
Slava Pestov fd84bb98bc strings: move string-nth primitive out of the VM and into the library 2010-05-03 17:34:12 -04:00
Slava Pestov adeb6fb68f vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Doug Coleman 9502f6f091 Save images to a temporary file first, then call MOVE_FILE to avoid writing incomplete and truncated images. 2010-01-22 12:59:20 -06:00
Slava Pestov 0165daf56c Stop wearing monocle and use the term "entry point" instead of "XT" throughout VM and compiler; also remove two unused relocation types 2010-01-18 20:54:00 +13:00
Slava Pestov a942e2c34d vm: eliminating register variables work in progress. Works on x86-32 with non-optimizing compiler 2009-12-19 10:59:56 +13:00
Slava Pestov 31a260b74c vm: big overhaul of non-optimizing compiler
- change some primitives into sub-primitives: fixnum+ fixnum- fixnum* inline-cache-miss inline-cache-miss-tail
- rename some relocation types for clarity
- some other minor re-organizations and cleanups
2009-12-15 07:20:09 -05:00
Slava Pestov 912b1265fc Split literal table into literal and parameter tables, literal table is discarded after code block initialization 2009-12-02 04:28:15 -06:00
Slava Pestov 8a25e8365a vm: Clean up more code duplication and rename a few methods 2009-12-02 01:17:30 -06:00
Slava Pestov 585a1a7fbe vm: fix fencepost error in write barrier on large object allocation; fixes benchmark.sort crash 2009-11-11 19:31:18 -06:00
Slava Pestov 4168ffbcee New identity-hashcode primitive 2009-11-10 21:18:54 -06:00
Slava Pestov 065dac3736 vm: simpler object space implementation. begin-scan/next-object/end-scan primitives replaced by a single all-instances primitive 2009-11-05 21:49:03 -06:00
Slava Pestov 99e3b9c59c vm: don't do a data compaction when growing the data heap, speeds up data heap grow by a bit 2009-10-31 21:06:34 -05:00
Slava Pestov 074200a213 vm: make some more ctors explicit just for kicks 2009-10-24 23:02:58 -05:00
Slava Pestov 7142274aef vm: combine heap_block and code_block structs, eliminates some boilerplate 2009-10-24 21:33:31 -05:00
Slava Pestov 6c561b5c4c vm: rename userenv to special_objects 2009-10-23 00:33:53 -05:00
Slava Pestov 6ee56ca93a vm: use iostreams instead of printf for debug messages, clean up a few things 2009-10-21 20:12:57 -05:00
Slava Pestov a03a817bdb vm: mark sweep gc for tenured space work in progress 2009-10-20 22:20:49 -05:00
Slava Pestov 056ccc6741 vm: split off free_list_allocator from heap class, rename zone to bump_allocator 2009-10-20 15:26:11 -05:00
Slava Pestov e2dfe160dc vm: working on making heap more generic 2009-10-20 10:22:06 -05:00