Commit Graph

70 Commits (4bdeaad1125a76eb06ede230250f6d3b71641c48)

Author SHA1 Message Date
Björn Lindqvist 365b39e0cc VM: change lot of visitation objects to use cool lambda functions instead 2015-07-06 22:49:38 +02:00
Björn Lindqvist fce5d4353a VM: replace binary_payload_start() with slot_count()
This should simplify a little the address calculations when visiting
slots of an object
2015-07-06 22:49:38 +02:00
Björn Lindqvist 66eb9f1fe5 VM: split the size() method into base_size() and aligned_size() 2015-07-06 22:49:38 +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
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 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 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 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 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 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 af270cb4d8 VM converts the methods callstack::frame_top_at and code_block::offset to use cells instead of void*'s 2015-01-15 09:29:13 +00:00
Björn Lindqvist eb7a5ab1ba VM: some more fixing to make the types match better, converting void* to cell 2015-01-15 09:29:13 +00:00
Björn Lindqvist 1cec8a7814 VM: modifying the uninitialized_blocks map in place instead of creating a new one is more efficient 2014-12-04 10:23:34 -08:00
Björn Lindqvist 8741dbefce VM: bignum_roots traversal code deleted! 2014-11-17 17:27:35 -08:00
Björn Lindqvist 85dade6914 VM: use a free_list_allocator for the callbacks, that way they can
individually be freed
2014-09-29 07:30:20 -07:00
Björn Lindqvist 4015565cf6 VM: "formalize" the callback_heaps object allocation using a
bump_allocator<code_block>

The advantage of doing it this way is that you can reuse the existing
each_object method to iterate all callbacks
2014-09-29 07:30:20 -07:00
Björn Lindqvist 237772daae VM: dont scrub and check when visiting a callstack object
callstack objects doesn't have stacks so it doesn't make sense to scrub
and check. also added the methods check_stack and scrub_stack to deal
with code duplication
2014-09-08 14:54:18 -07:00
Björn Lindqvist 9836d6a1d0 VM: move the stack scrubbing logic to call_frame_slot_visitor to avoid visiting the callstack twice
primitive_minor_gc() iterates the stack twice, first to scrub stack
locations, then to trace overinitialized ones and gc roots. By running
visit_callstack() before visit_stack_elements() you only need to do it
once.
2014-09-08 14:54:18 -07:00
Björn Lindqvist 8fb8313251 VM: use the check_d and check_r to trace the overinitialized stack locations 2014-09-08 14:54:18 -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 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
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 7b1b1eef23 VM: Remove unnecessary _ suffix in constructors 2013-05-12 23:20:43 -04:00
Erik Charlebois 26ff071205 VM: Remove unnecessary explicit keywords 2013-05-12 21:48:38 -04:00
Erik Charlebois 6d5197923c VM: Refactor slot_visitor.hpp to Factor style 2013-05-12 13:24:47 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04: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 9236c05e60 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 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 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 c31530caec vm: strip out call-counting profiler
This makes the separate "code" and "entry_point" fields in word and quotation redundant, so also remove them to reclaim an additional cell per word and quotation object, which should help with #318.
2011-11-10 16:01:07 -08:00
Joe Groff be8db5aed3 vm: sample thread object rather than raw context 2011-11-02 13:23:18 -07:00
Joe Groff 7da8a9776f vm: sample code block owners instead of blocks 2011-11-02 13:23:17 -07:00
Slava Pestov 813e13140a vm: fix 64-bit regression 2010-10-09 15:14:14 -07:00
Slava Pestov 0fc8ee8250 Fix win64 compile error 2010-10-09 16:03:46 -05:00
Doug Coleman 8a0d0fca83 Revert previous patch; not simply a typo. Still broken on win64. 2010-09-29 20:49:37 -05:00
Doug Coleman 466e630dc9 Win64 Windows SDK hates int/cell type errors 2010-09-29 17:43:27 -05:00
Slava Pestov 6b5fffc026 compiler: preliminary implementation of tracking derived pointers in GC maps 2010-09-27 20:12:44 -07:00
Slava Pestov 174463e156 vm: fix another compile warning on 32-bit Windows 2010-06-17 01:04:03 -05:00
Slava Pestov e86f434f26 Add GC maps to ##box, ##box-long-long, ##alien-invoke, ##alien-indirect and ##call-gc; remove ##gc-map instruction 2010-06-14 19:39:46 -04:00
Slava Pestov 70b8a74208 vm: have to be extra careful when messing with return addresses 2010-06-13 18:12:57 -04:00
Slava Pestov 3f28c0e7f5 vm: context switching needs to scrub the return address 2010-06-12 19:54:31 -04:00
Slava Pestov 806e54630a GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov 560c119cd2 vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00