Björn Lindqvist
cb55fcf20f
VM: prettier and more detailed output when dumping generations
2015-10-08 16:25:35 +02:00
John Benediktsson
bd04290187
vm: fix signature for safe_fopen.
2015-09-30 19:03:39 -07:00
Björn Lindqvist
2536b6cd93
VM: fix move_file called from save_image
...
save_image() shouldn't throw exceptions because if the 'then_die'
argument is t it would leave factor in an inconsistent state. So
therefore move_file() should be fixed and raw_fclose() called instead of
safe_fclose().
2015-09-29 23:13:10 +02:00
Björn Lindqvist
cb0bf3b1ce
VM: merge memory_protection_error() with memory_signal_handler_impl()
2015-08-24 07:23:40 -07:00
Björn Lindqvist
51daaf6be4
VM: the windows_image_path method is unused
2015-08-24 07:23:40 -07:00
Björn Lindqvist
4efef7bfd9
VM: merge the compute_dlsym_toc_address() with the
...
compute_dlsym_address() method
it makes the code slightly more cluttered but you get rid of a lot of
special casing for the ppc platform
2015-08-23 18:36:31 -07:00
Björn Lindqvist
a53d5be683
VM: make allot_alien() and ffi_dlsym() use cell instead of void*
...
this way we get rid of a bunch of superfluous casts
2015-08-23 18:36:31 -07:00
Björn Lindqvist
7f545271f4
VM: new iteration method each_object_each_slot()
...
used by find_data_references() and dump_edges() instead of the functor structs
2015-08-23 18:36:31 -07:00
Björn Lindqvist
59b7a50567
VM: removing the get_datastack/retainstack/callstack primitives
...
they can all be implemented using the
datastack/retainstack/callstack-for primitives and the less primitives
the better!
2015-08-23 18:36:30 -07:00
Björn Lindqvist
df669298ce
VM: split dispatch_signal_handler into two methods, one for resumable
...
and one for non-resumable signals
2015-08-14 20:19:55 -07:00
Björn Lindqvist
2b1c6ca11a
VM: move the frame_predecessor() method to the code_heap class
2015-08-14 20:19:54 -07:00
Björn Lindqvist
504be0c7cb
VM: signal_error and fp_trap_error not needed, call general_error directly
2015-08-04 16:02:10 +02:00
Björn Lindqvist
73956db33a
VM: a bunch of methods on factor_vm that can be converted into free
...
functions
I think that makes it easier to see whats going on than having
everything added to factor_vm
2015-08-04 16:02:09 +02:00
Björn Lindqvist
ae725b737a
VM: lets merge entry_points.hpp with vm.hpp, so you have one less header
...
file to worry about
2015-08-04 16:02:09 +02:00
Björn Lindqvist
f5f8ce1501
VM: word_stack_frame_p() is not used and find_all_quotations() is
...
trivial so those methods can be removed
2015-08-04 16:02:09 +02:00
Björn Lindqvist
49a406d880
VM: using compute_external_address everywhere instead of store_external_address
2015-08-04 16:02:09 +02:00
Björn Lindqvist
50318a6f77
VM: new method compute_external_address
2015-08-04 16:02:08 +02:00
Björn Lindqvist
718ea51d8a
VM: remove the collect_compact_code_impl(), collect_compact_impl() can
...
be used instead
this might slow down collect_growing_heap(), but heap growth happens so
rarely that it shouldn't matter
2015-08-04 16:02:08 +02:00
Björn Lindqvist
b44db91f65
VM: init_code_heap is trivial and only used once, so let's remove it
2015-08-04 16:02:08 +02:00
John Benediktsson
4c2c8f133f
vm: rename some primitives, and some cleanup.
...
* quot-compiled? => quotation-compiled?
* optimized? => word-optimized?
2015-07-15 11:13:52 -07:00
Björn Lindqvist
b9b75c272b
VM: let's merge (save-image) and (save-image-and-exit) into one 3
...
arg (save-image). it's good not to have to many similar primitives
2015-07-12 22:36:59 +02:00
Björn Lindqvist
d608f3377b
VM: get_entry_point is unused
2015-07-12 22:36:59 +02:00
Björn Lindqvist
e14d7a3508
VM: make the bignum_to_* family free functions, they don't need to be
...
members of factor_vm
2015-06-27 16:14:58 +02:00
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