Björn Lindqvist
ed702209ce
VM: fix bignum>fixnum-strict conversion, previously most-negative-fixnum
...
>bignum bignum>fixnum-strict didn't work
2015-06-29 08:19:42 +02:00
Björn Lindqvist
35b04f8ec1
VM: fixes a bug with the handling of 0 bignums, and declares bignum/mod
...
to maybe output fixnums
2015-06-27 16:14:58 +02:00
Björn Lindqvist
2f835d3666
compiler.tree.propagation.*: implements downgrading to fixnum for the
...
mod word, maybe a first step in solving #224
factor_vm::primitive_bignum_mod is changed so that it outputs a fixnum
if the value is small enough. Then the compiler can take advantage of
knowing that expressions like [ >bignum 10 mod ] always result in a
fixnum [-9,9] and inline more arithmetic.
2015-06-27 16:14:58 +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
Doug Coleman
31fe045560
vm: differentiate which strerror is printing the message.
2015-06-08 17:58:00 -07:00
Doug Coleman
1d58f827a2
platform.hpp: Indent so I can see wtf is going on with the preprocessor control flow.
...
Look for ``__linux__`` on linux instead of ``linux`` because compiling with
-std=c++11 removes the ``linux`` preprocessor symbol.
2015-06-05 10:53:02 -07:00
Doug Coleman
a83df49ecc
ffi_test.c: Casting a 32bit int to a 64bit pointer is invalid. Instead,
...
cast it to a 64bit int then to the pointer. Found with visual studio 2015.
2015-06-05 10:21:20 -07:00
Doug Coleman
f26c7fc66d
utilities.hpp: Use auto pointer instead of gcc extension typeof().
...
Fixes #1336 .
2015-06-05 10:20:32 -07: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
428937dbeb
VM: make FACTOR_FOR_EACH not call .end() more than once
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
Björn Lindqvist
a0e7bb8770
VM: move free_list_allocator<Block>::next_allocated_block_after to
...
tenured_space::next_allocated_object_after, because it's only used there
2015-06-05 02:14:49 +02:00
Björn Lindqvist
f1ca83524a
VM: new functions raw_fclose and raw_fread
...
These need to be used when the image is loaded because there is no
context so you can't throw io errors yet.
2015-06-05 02:14:49 +02:00
Björn Lindqvist
9d289e35f4
VM: macro FACTOR_FOR_EACH used in more places to drive iteration
2015-06-05 02:14:49 +02:00
Björn Lindqvist
b7bd0668b3
VM: macro FACTOR_FOR_EACH to make stl container iteration easier to express
2015-06-05 02:14:48 +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
8e1f3a0e51
VM: after reset_datastack and retainstack clear the stack segment. makes
...
it easier to find bad accesses to shadow data
2015-05-22 12:22:28 -07:00
Björn Lindqvist
183ec83a6d
VM: possible fix for #1319 .
...
Fix for reset_context() so that the top two stack items are never
removed from the stack so if the parent->init_context(ctx) call triggers
a GC, those items are never collected.
2015-05-22 12:22:27 -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
6ca83e7588
Reorganising bootstrap files
...
All the bootstrap.factor scripts in cpu/ are run by the bootstrap to
make boot images, but aren't used otherwise. So I think it's cleaner to
put them in one directory inside the bootstrap hierarchy.
2015-05-22 12:22:24 -07:00
Björn Lindqvist
bf7161604e
VM: simplified logic in data_heap_checker
2015-05-17 07:59:34 +02: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
a6e2834252
VM: refactoring to use the visit_object_array method
2015-05-09 20:04:21 -07:00
Björn Lindqvist
0a6486ef78
VM: the aging_policy and nursery_policy classes are so small that they
...
can be in the same cpp file with the methods that use them
2015-05-09 20:04:21 -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
685a795aa0
VM: to_tenured_collector isn't needed, it's just a normal collector instance
2015-05-09 20:04:21 -07:00
Björn Lindqvist
9bfc43144e
VM: debug macros FACTOR_PRINT and FACTOR_PRINT_MARK to make better debug
...
printing messages than just using std::cout
2015-05-09 20:04:21 -07:00
Björn Lindqvist
fa0ff77c45
VM: reset the unused parts of the data and retain stack segments with a bit pattern (good for debugging)
2015-04-29 09:31:54 -07:00
Björn Lindqvist
acc1bd3221
compiler.*: removing the check-d and check-r slots from gc-map and adjusting code that depended on those
2015-04-29 09:31:53 -07:00
Björn Lindqvist
2cd2aa498a
VM: the compiler doesn't emit any live overinitialized locations anymore
...
Any overinitialized location immediately becomes garbage and is not
reused again. This is very nice because then the gc maps can be
simpler again.
2015-04-29 09:31:53 -07:00
Björn Lindqvist
1d251f7b6a
VM: new function visit_object to replace trace_object
2015-02-28 14:14:30 -08: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
0798928996
VM: cleanup of some infrequently used functions that can be replaced with direct code
...
also replacing some bitshifts with easier to understand multiplies and
divides, they are equally fast nowadays
2015-02-28 14:14:30 -08:00
Björn Lindqvist
ab75e3b05d
VM: splits out the little ugly scan_next-object + goto-loop into a function trace_card()
2015-02-28 14:14:30 -08:00
Björn Lindqvist
8e91ca3e31
VM: simplification of the trace_partial_objects function
2015-02-28 14:14:30 -08:00
Björn Lindqvist
a43a455990
VM: the unmarker classes are not needed, easier to just send the unmask pattern to the trace_cards function directly
2015-02-28 14:14:30 -08:00
Björn Lindqvist
b5a206c587
VM: new function visit_mark_stack() to factor out the mark stack iteration
2015-02-28 14:14:29 -08:00
Björn Lindqvist
667e5768ba
VM: it's confusing that slot_visitors are called "workhorse" sometimes, let's standardize the name "visitor"
2015-02-28 14:14:29 -08:00
Björn Lindqvist
5490c50217
VM: visit_roots and visit_contexts where always called in tandem, make a new method visit_all_roots that calls them both
2015-02-28 14:14:29 -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
d18c48c75b
VM: possible fix for #1265 . the size of the stack frame appears to have been miscalculated in iterate_callstack which this commit fixes.
2015-01-15 09:29:14 +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
4d7bc4c169
VM: merge of slot_visitor and code_block_visitor
...
Looks like there is no reason for them to be separate classes and by
merging them you can simplify lots of code.
2015-01-15 09:29:14 +00:00
Björn Lindqvist
d2aea0f606
VM: replaced the reset_generation() generic method with one method for each generation
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
b61eaa8a16
VM: the full_collector class isn't needed since it is only used once
2015-01-15 09:29:14 +00:00
Björn Lindqvist
693e8ad33a
VM: the clear_mark_bits methods are only called once -- make the calls inline instead
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