Commit Graph

370 Commits (a6e191a490d5707877c487a9515865f0d810723a)

Author SHA1 Message Date
Björn Lindqvist 423e983514 VM: refactoring to get rid of the megamorphic_call_stub and check_code_pointer() words 2014-12-04 10:23:33 -08:00
Björn Lindqvist 885b5c7043 VM: no need for a nursery_space class, it's just a bump_allocator 2014-12-04 10:23:33 -08:00
Björn Lindqvist 50c74fc496 VM: get rid of the duplicated nursery instance in vm->data->nursery
vm.nursery and vm->data->nursery are different objects. They get out
of sync when Factor code bumps vm.nursery but leaves vm->data->nursery
unchanged. The emptiness of vm->data->nursery meant that each_object()
never iterated it.
2014-11-21 02:16:03 -08:00
Björn Lindqvist 2a5e1e06f3 VM: each_object() can't iterate the nursery so instead we assume it's empty 2014-11-21 02:16:03 -08:00
Björn Lindqvist 161eb0bb49 VM: fixed bignum_divide_unsigned_large_denominator so that it wont data_root-protect NULL-pointers 2014-11-17 17:27:36 -08:00
Björn Lindqvist 8741dbefce VM: bignum_roots traversal code deleted! 2014-11-17 17:27:35 -08:00
Björn Lindqvist 981a02be27 VM: Erasing the last traces of GC_BIGNUM from bignum.cpp 2014-11-17 17:27:35 -08:00
Björn Lindqvist 7d6f282d91 VM: conversion of many more bignum.cpp methods to use data_roots instead
of gc_bignum
2014-11-17 17:27:35 -08:00
Björn Lindqvist 2fcea047d2 VM: bignum_new_sign, bignum_maybe_new_sign and bitnum_magnitude_ash
converted to using data_roots
2014-11-17 17:27:35 -08:00
Björn Lindqvist a4df09a34e VM: a lot of methods in bignum.cpp converted to use data_roots instead of gc_bignums 2014-11-17 17:27:35 -08:00
Björn Lindqvist e00798cd2a VM: new primitive free-callback which is able to free a callback
previously allocated using <callback>
2014-09-29 07:30:21 -07:00
Björn Lindqvist 4a96e6163b VM: new primitive (callback-room) for querying the VM about memory usage
The word works exactly like (code-room) except it looks at the memory
usage in the callback heap instead of the code heap.
2014-09-29 07:30:21 -07:00
Björn Lindqvist a6e0867b22 VM: change type of bignum_roots and remove unnecessary not-null checks
Declaring bignum_roots to contain bignum** instead of cell avoids some
superfluous casts. Casting it to cell is wrong because the items in it
are never tagged. And due to a earlier commit, bignum_roots will never
contain NULL:s so checking for them is not needed.
2014-06-12 13:50:10 -07:00
Björn Lindqvist 8ac3b80173 VM: rename all variables named "bignum" in bignum.cpp to "bn"
The name can cause compiler errors because it's the same as the type
name. It only matters in some functions, but I like consistency so I
renamed it everywhere.
2014-06-12 13:50:10 -07:00
Björn Lindqvist 0c9e61ca99 VM: refactoring that removes data_root_ranges
instead of storing data_root_ranges in data_roots, you can just store
cell pointers directly. the advantage with doing it that way is that
registration and traversal code becomes simpler (and slightly faster).
2014-06-12 13:50:10 -07:00
John Benediktsson e9e1fd4e6a vm: generate a to_fixnum_strict to workaround an odd io.monitors issue. 2014-06-07 12:06:03 -07:00
John Benediktsson eeaa91d6c1 vm: using bignum>fixnum-strict in integer>fixnum-strict. 2014-06-07 09:46:05 -07:00
Björn Lindqvist a9a52d9174 VM: bignum_to_fixnum_strict and an accompanying vm error in case the conversion fails 2014-06-07 12:13:59 +02:00
Björn Lindqvist 877e3a12e1 VM: allot_array_1, allot_array_2 are unused and primitive_array should use allot_array 2014-06-07 12:13:59 +02:00
John Benediktsson 6c703bbd6c vm: adding a fast path for bignum sq. 2014-06-06 10:45:09 -07: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 88d7c10d03 VM: Replace u8-64, s8-64, cell, fixnum with stdint.h equivalents 2013-05-13 00:28:25 -04:00
Erik Charlebois b918c3e646 VM: Remove redundant #ifdef FACTOR_DEBUGs
FACTOR_DEBUG checks around asserts aren't needed, since FACTOR_ASSERT is
already conditionally defined by FACTOR_DEBUG.
2013-05-12 23:44:32 -04:00
Erik Charlebois 5614985c3d VM: Refactor vm.cpp/hpp to Factor style 2013-05-12 13:24:48 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04:00
Doug Coleman 2b33dde782 vm: Add more Allocates memory comments. 2013-03-25 17:52:30 -07:00
John Benediktsson 5be15d7e3f vm: more use of ctx->replace(). 2013-03-22 09:17:02 -07:00
John Benediktsson 22c26ff3f5 vm: adding bignum_gcd primitive. 2012-04-05 09:17:35 -07:00
Joe Groff b6f323450f vm: load mega cache object before popping frame
Fixes #457 harder
2011-12-20 14:38:01 -08:00
Joe Groff a1ee881435 vm: get rid of now-trivial innermost_stack_frame 2011-12-14 09:56:49 -08:00
Joe Groff 604ceb957c vm: replace remaining stack_frame-based logic 2011-12-14 09:56:49 -08:00
Joe Groff d74f194b07 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 f6a5f48da0 vm: remove iterate_callstack_object 2011-12-14 09:56:48 -08:00
Joe Groff a1958c67bd vm: callstack_reversed for callstack_to_array 2011-12-14 09:56:48 -08:00
Joe Groff 0af5fff27c remove iterate_callstack now that it's unused 2011-12-14 09:56:48 -08:00
Joe Groff e6a80aa9aa vm: callstack_reversed in code_block_visitor 2011-12-14 09:56:48 -08:00
Joe Groff d12b6e375b vm: iterate_callstack_reversed in slot_visitor 2011-12-14 09:56:47 -08:00
Joe Groff e116bc497b vm: reversed callstack iteration 2011-12-14 09:56:47 -08:00
Joe Groff e2fafaed9c 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 e21f316583 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 26226d460e vm: factor out embedded image detection code 2011-11-27 14:39:21 -08:00
Joe Groff cca526df73 vm: support self-executing image file 2011-11-27 12:37:54 -08: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 5e99a7bbbf vm: disable SIGINT handler while in factorbug
Fixes #410
2011-11-15 18:50:42 -08:00
Joe Groff 3fc82282f7 vm: close_console before exiting anywhere
Add a factor_vm::exit function that does close_console() before ::exit-ing
2011-11-12 23:05:44 -08:00
Philipp Brüschweiler db19efe1b3 vm: close the console when exiting
This prevents an endless loop caused by the nvidia drivers on linux.
See http://www.nvnews.net/vbulletin/showthread.php?t=164619
2011-11-12 23:05:43 -08:00
Joe Groff e0dc236725 cpu.*.bootstrap: clear faulting flag directly
No reason to go through a safepoint in unwind-native-frames really.
2011-11-12 13:02:57 -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 2c5014e74e vm: "edges" command for factorbug 2011-11-11 10:12:36 -08:00