Commit Graph

69 Commits (master)

Author SHA1 Message Date
Doug Coleman 2a409c79e0 vm: Fix unused variable warnings on Windows. 2018-07-13 00:48:58 -05:00
Björn Lindqvist 752c895d23 VM: refactor gc_event so that the phase times are stored in an array
So that you don't need a new method for each gc phase to time.
2016-10-20 00:34:18 +02:00
Björn Lindqvist f147bd4404 VM: uppercasing gc_op 2016-10-19 09:09:32 +02:00
Björn Lindqvist aace892527 VM: rename of collect_growing_heap_op and collect_growing_heap()
The idea is to "make room" for collect_growing_code_heap_op and
collect_growing_code_heap() to enable code heap growth.
2016-10-13 02:13:09 +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
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Björn Lindqvist 58ad5fb4ce VM: all the started_<blah>() replaced with reset_timer() 2016-04-24 15:21:17 +02:00
Björn Lindqvist da3de080ee VM: callback_entry_point() and update() can be removed 2015-09-02 21:54:39 +02: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 49a406d880 VM: using compute_external_address everywhere instead of store_external_address 2015-08-04 16:02:09 +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 18ab09e493 VM: object_compaction_updater -> lambda func 2015-08-04 16:02:08 +02:00
Björn Lindqvist a5a7232b8f VM: use a function update_relocation to replace the
code_block_compaction_relocation_visitor struct
2015-08-04 16:02:08 +02:00
Björn Lindqvist 4bc0720e51 VM: more changes of structs to lambda functions 2015-07-06 22:49:38 +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 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 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 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 f0bf693beb VM: free_list_allocator::first_block, last_block and next_block_after can be refactored away 2015-01-15 09:29:13 +00:00
Björn Lindqvist 1beac119d8 VM: removes the template parameter from mark_bits
since mark_bits only deals with arithmetic on memory addresses, it
doesn't need to be specialized so it can be untemplateized
2015-01-15 09:29:13 +00:00
Björn Lindqvist 615420fe61 VM: calls to visit_code_roots() replaced with visit_uninitialized_code_blocks() 2015-01-15 09:29:13 +00: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
Steven Stewart-Gallus e6dade3f94 Lower the stack usage of a few functions
In vm/compaction.cpp I rescoped some variables to lower the stack usage
from 592 to 560 bytes. I wasn't very successful with this. The stack
usage is larger than it looks because methods on the structures used
take an implicit this pointer and a reference to the data (so the data
has to live out it's full scope and can't be put in a register).

In vm/debug.cpp I made a large (1024 bytes) stack allocated buffer
simply dynamically allocated.

In vm/os-unix.cpp I rescoped signal handling structures to not coincide
with each other and reduced a very large (1024 bytes) amount of stack
usage to less than 500 bytes.
2014-06-19 14:55:57 -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 b918c3e646 VM: Remove redundant #ifdef FACTOR_DEBUGs
FACTOR_DEBUG checks around asserts aren't needed, since FACTOR_ASSERT is
already conditionally defined by FACTOR_DEBUG.
2013-05-12 23:44:32 -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 2bed6f6a25 VM: Refactor compaction.cpp to Factor style 2013-05-12 13:24:42 -04:00
Doug Coleman 106ecdb6dd compaction: Less than is the new greater than. Fixes #558. 2012-07-25 17:57:50 -07:00
Doug Coleman e9ec95ad4f compaction: Inifnite headaches--cured! Two compact functions, one was not like the other. 2012-05-27 18:26:03 -07: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 d12b6e375b vm: iterate_callstack_reversed in slot_visitor 2011-12-14 09:56:47 -08:00
Joe Groff 083b856604 vm: reinitialize all_blocks from scratch after gc
Faster and more likely to be correct than trying to fixup the existing set
2011-12-12 19:05:48 -08:00
Joe Groff 81911b9f87 vm: initialize all_blocks map from image
um, code blocks from the image need to go in the set too
2011-11-23 11:11:26 -08:00
Joe Groff 2705fc67cb vm: keep a set of all code_blocks in the code_heap
This way looking up code blocks by return address is an O(log n) set lookup rather than an O(n) linear scan.
2011-11-23 11:11:26 -08:00
Joe Groff e3e2788414 vm: walk code roots from sample callstacks 2011-11-02 13:23:08 -07:00
Slava Pestov 0f5e0eada5 vm: fix high_fragmentation_p assertion 2011-09-05 23:30:28 -07:00
Slava Pestov 83b8717bad Clean up some GC logic and fix a bug where large object allocation could grow the heap unnecessarily 2011-09-05 16:28:00 -07:00
Slava Pestov 2498a4d881 vm: don't call nano_count() from the GC at all, unless GC event recording is on 2010-09-04 13:21:45 -07:00
Slava Pestov 4405a66f99 vm: fix RT_HERE fixup on image load 2010-06-11 21:54:47 -04:00
Slava Pestov 806e54630a GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov 637a77c018 Stop wearing monocle and use the term "entry point" instead of "XT" throughout VM and compiler; also remove two unused relocation types 2010-01-18 20:54:00 +13:00
Slava Pestov e4da687413 vm: Tweak Factor VM to compile with Microsoft Visual Studio on Windows, in addition to Mingw. Add an Nmakefile which can be used for this purpose. Rename Makefile to GNUmakefile. 2010-01-17 03:43:22 +13:00
Slava Pestov 7271900e6f vm: code cleanup 2009-12-26 15:24:21 +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 eb840dcf41 RT_HERE now takes its argument from the literal table rather than the parameter table, reducing image size further 2009-12-02 04:55:48 -06: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 d49c86ba11 vm: Clean up more code duplication and rename a few methods 2009-12-02 01:17:30 -06:00