Björn Lindqvist
40b7805e0a
VM: fixes so that raw_fread and safe_fread returns a size_t again
2015-06-05 02:14:49 +02:00
Björn Lindqvist
0713f28bdb
VM: safe_fread needs to return an int so you can return -1 on error
2015-06-05 02:14:49 +02:00
Doug Coleman
27590b514c
vm: Only call fclose() once. Rename io_error() to io_error_if_not_EINTR() to be more explicit.
...
Fixes #1335 .
2015-06-03 14:35:48 -07:00
Björn Lindqvist
016614747d
VM: the delete_context() and reset_context() api functions can be
...
simplified a bit
The functions always operates on parent->ctx, so passing a context*
parameter is redundant. This enables shorter assembly code for
the (start-context-and-delete) and (set-context-and-delete) primitives.
2015-05-22 12:22:26 -07:00
Björn Lindqvist
3887b58c02
VM: cleanups, like removing redundant paranthesis and removing method
...
declarations that doesn't exist
2015-05-09 20:04:22 -07:00
Björn Lindqvist
e4bb3058e0
VM: the copying_collector only contained one method, so it can easily be
...
merged with its base class
2015-05-09 20:04:21 -07:00
Björn Lindqvist
6b29c0ea00
VM: refactoring to remove redundancy in retainstack|datastack_to_array
2015-02-28 14:14:30 -08:00
Björn Lindqvist
f5dc4afb2e
VM: better error message in case factor_vm::store_external_address fails
2015-01-28 14:58:22 +00:00
Björn Lindqvist
434e4ef4b7
VM: fix the debug printing so that instead of always printing to std::cout, you supply the stream to print to
2015-01-28 14:58:21 +00:00
Björn Lindqvist
ee5fd49b9e
VM: simplified fixup_gc_workhorse::fixup_data by mering lots of functions only used once
2015-01-15 09:29:14 +00:00
Björn Lindqvist
8ea1eea4e1
VM: instead of passing around the trace_contexts_p arg, just clear the contexts in primitive_save_image_and_exit() it has the same effect but is simpler
2015-01-15 09:29:14 +00:00
Björn Lindqvist
dc9e937beb
VM: vm::iterate_active_callstacks is only used once, so it's simpler if the code body is "inline"
2015-01-15 09:29:14 +00: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
Björn Lindqvist
e47181e87a
VM: change type of callstack_top and callstack_bottom from void* to cell
...
cell and void* is always the same size, but now you can remove lots of
redundant type casts from void* to cell.
2015-01-15 09:29:13 +00:00
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