Commit Graph

59 Commits (ee5fd49b9eb5d35d975b63c59d3f36ec01784629)

Author SHA1 Message Date
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
Slava Pestov 6aee6b3adc Add context-specific special object table, generalizing catchstack_save and current_callback_save fields of context struct 2010-03-18 22:06:00 +13:00
Slava Pestov 0068bce934 vm: big overhaul of non-optimizing compiler
- change some primitives into sub-primitives: fixnum+ fixnum- fixnum* inline-cache-miss inline-cache-miss-tail
- rename some relocation types for clarity
- some other minor re-organizations and cleanups
2009-12-15 07:20:09 -05:00
Slava Pestov 68c09f0e93 Split literal table into literal and parameter tables, literal table is discarded after code block initialization 2009-12-02 04:28:15 -06:00
Slava Pestov 147edb1ce9 vm: update callback stub machine code at the end of compaction to prevent it from seeing an inconsistent data stack 2009-12-02 03:31:57 -06:00
Slava Pestov c6602bda27 Big cleanup of literal table and relocation-related code
- new way to iterate over instruction_operands cleans up relocation code
- move some methods out of the VM class to clean up code
- if debugging is on, die earlier if attempting to allocate inside GC
- callback heap entries are now code_blocks
- replace block_granularity with data_alignment
2009-12-02 00:48:41 -06:00
Slava Pestov 58c21a1a11 vm: new image relocation that doesn't use literal table 2009-11-27 17:05:08 -06:00
Slava Pestov bfd4cce364 vm: compaction now updates the needs_fixup set 2009-11-24 19:29:59 -06:00
Slava Pestov 001a3f2847 vm: mark sweep now traces code block references; rename embedded_pointer to instruction_operand 2009-11-23 19:17:12 -06:00
Slava Pestov b28619ce2f vm: minor GC traces embedded pointers 2009-11-22 13:37:39 -06:00
Slava Pestov 57c541ea46 vm: eliminating literal table work in progress 2009-11-07 16:16:09 -06:00
Slava Pestov 11075828e5 vm: faster data_root and <array> primitive 2009-11-06 05:30:37 -06:00