Doug Coleman
2a409c79e0
vm: Fix unused variable warnings on Windows.
2018-07-13 00:48:58 -05:00
Björn Lindqvist
0590ebf914
VM: storing some sample data in the heap ( #337 )
...
This is the first half of it. In the second half the samples array
should also be stored in the heap.
2016-11-23 09:44:17 +01:00
Björn Lindqvist
f0eec26f3c
VM: reorg and more comments
2016-10-08 07:04:28 +02:00
Björn Lindqvist
9eab4b5652
VM: make visit_instruction_operands() skip over uninitialized blocks
...
It will crash otherwise when compacting the code heap.
2016-09-29 06:35:35 +02:00
Björn Lindqvist
d71bd83f57
VM: removing the 1-arg overload of iterate() (better to be explicit about the fixup)
2016-09-22 17:03:38 +02:00
Björn Lindqvist
ab7e077b1d
Docs: fixing docs & comments to work with new stack clearing
2016-09-12 02:11:51 +02:00
Björn Lindqvist
349f99661d
compiler.*: Remove the scrubbing part of the GC maps
...
Instead of generating GC maps which describe which stack locations that
are uninitialized, we emit ##clear instructions for those locations in
front of ##call-gc instructions. This makes the context root scanning
much simpler because the GC can assume that all stack slots are
initialized. It also removes the compiler.cfg.stacks.vacant pass and
seem to reduce the image size slightly because many fewer GC maps needs
to be emitted.
2016-09-11 20:34:44 +02:00
Alexander Iljin
0d57734dab
vm: replace block comments /**/ with line comments //
2016-09-09 05:47:52 +02:00
Björn Lindqvist
c646db3ae5
VM: fixing small style issues
...
Like aligning comments and changing //-comments to /* */
2016-07-02 15:50:59 +02:00
Björn Lindqvist
6b95813dbc
VM: refactor the immediate_p check out of visit_pointer()
...
This avoids reassigning to slots that are never changed. It makes the minor-gc pass 2% faster.
2016-06-07 14:42:06 +02:00
Björn Lindqvist
583fb5825b
VM: removes the collector class
...
The cheneys_algorithm() method can be moved to slot_visitor (because it
kind of visists objects), and then there is no need for the collector
class.
2016-05-04 17:52:04 +02:00
Björn Lindqvist
f629a95b03
VM: moving collector methods to slot_visitor methods
...
collector::trace_cards moved to slot_visitor::visit_cards and
collector::trace_code_heap_roots moved to
slot_visitor::visit_code_heap_roots. Both those methods are pointer visitors
2016-05-04 00:32:17 +02:00
Björn Lindqvist
0c9c0b2f82
VM: removes a few methods related to relocation handling
...
They are only used once, so it is simpler to "inline" them
2015-12-13 13:56:36 +01:00
Björn Lindqvist
46bfcbf3a2
VM: the rel_type() and rel_offset() accessors in instruction_operand can be removed
2015-12-13 13:56:36 +01:00
Björn Lindqvist
1a72f731e0
VM: now special-objects is used for -1, 0, 1 and t
...
The fields in the image_header aren't read or written to but I haven't
changed the format yet.
2015-12-10 10:22:38 +01:00
Björn Lindqvist
e14d820138
VM: move trace_partial_objects to visit_partial_objects since it is a
...
kind of visitation function
2015-08-14 20:19:55 -07:00
Björn Lindqvist
03d861976c
VM: new method visit_instruction_operands(), it replaces the instruction
...
operand iteration code in compaction.cpp and image.cpp
2015-08-04 16:02:09 +02:00
Björn Lindqvist
e565b0291f
VM: refactors slot_visitor by removing a lot of one-use methods
...
I think it's easier to see the code flow if small method bodies that are
only called once are inlined into visit_all_roots() instead
2015-08-04 16:02:09 +02:00
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