Commit Graph

52 Commits (fb3928f8073ccad00ddb1ed41c088e1333b1a53f)

Author SHA1 Message Date
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Björn Lindqvist 0274e889b9 VM: refactor tagged.hpp so it's not dependent on the factor_vm class
this way untag<byte_array>(relocation) can be used in code_blocks.hpp
2015-11-24 16:00:50 +01:00
Björn Lindqvist 5d7fb5da60 VM: smaller style-fixes, like removing redundant else clauses and this prefixes 2015-08-14 20:19:55 -07: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 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 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 e47181e87a VM: change type of callstack_top and callstack_bottom from void* to cell
cell and void* is always the same size, but now you can remove lots of
redundant type casts from void* to cell.
2015-01-15 09:29:13 +00:00
Björn Lindqvist a6e191a490 VM: the frame_return_address and set_frame_return_address functions aren't needed (clearer to read/write the pointers directly) 2015-01-15 09:29:13 +00:00
Doug Coleman 19685f4528 vm: jit::jit is a c++ constructor but it does not allocate objects to the Factor heaps.
Add annotations for gc allocating.
2014-02-14 20:29:26 -08: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 7b1b1eef23 VM: Remove unnecessary _ suffix in constructors 2013-05-12 23:20:43 -04:00
Erik Charlebois 2e20733ade VM: Refactor callstack to Factor style 2013-05-12 13:24:42 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04:00
Joe Groff 604ceb957c vm: replace remaining stack_frame-based logic 2011-12-14 09:56:49 -08: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 f6a5f48da0 vm: remove iterate_callstack_object 2011-12-14 09:56:48 -08:00
Joe Groff a1958c67bd vm: callstack_reversed for callstack_to_array 2011-12-14 09:56:48 -08:00
Joe Groff 0af5fff27c remove iterate_callstack now that it's unused 2011-12-14 09:56:48 -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
Erik Charlebois 64252dbdbc 32 and 64 bit Linux PPC support 2011-05-23 23:36:14 -04:00
Slava Pestov 560c119cd2 vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Slava Pestov 63edd20a55 vm: eliminating register variables work in progress. Works on x86-32 with non-optimizing compiler 2009-12-19 10:59:56 +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 6c2c87758a vm: rename gc_root to data_root, add code_root to fix a problem where code blocks would move underneath the PIC compiler if PIC compiler allocated enough 2009-11-02 18:10:34 -06:00
Slava Pestov 85b746e7b5 vm: simpler and more efficient code heap compaction; restructure a few things to get ready for runtime code heap compaction 2009-10-16 04:33:35 -05:00
Slava Pestov c4ef640f4d Big VM cleanup
- Move forward declarations of 'struct factor_vm' to one place
- Rename template parameters from T and TYPE to descriptive names. New convention: CamelCase for template parameters
- Change some higher-order functions taking function pointers into templates, and define classes overriding operator(). There's a bit of new boilerplate here but its more consistent than the old mish-mash approaches
- Put GC state into a gc_state struct
- Use exceptions instead of longjmp for non-local control transfer in GC
- In code GC, instead of interleaving code block tracing with copying, add code blocks which need to be revisited to an std::set stored in the gc_state
2009-10-03 08:47:05 -05:00
Phil Dawes 3a88d8c49e inlineimpl.hpp is toast 2009-09-29 19:53:10 +01:00
Phil Dawes 9b7412b8f8 Moved PRIMITIVE and PRIMITIVE_FORWARDs to primitives.[ch]pp 2009-09-27 19:42:18 +01:00
Phil Dawes e26bbbe9a0 removed VM_ASM_API_OVERFLOW (VM_ASM_API now regparm(3)) 2009-09-25 20:33:38 +01:00
Phil Dawes 83b0769eef renamed factorvm to factor_vm 2009-09-24 08:16:52 +01:00
Phil Dawes e566656e46 removed a bunch of superflous blank lines 2009-09-24 08:02:14 +01:00
Phil Dawes 58190c06dc passing ptr in boolean boxing and save_callstack_bottom 2009-09-16 08:17:26 +01:00
Phil Dawes 551a800d2f removed some global functions from callstack.cpp 2009-09-16 08:16:28 +01:00
Phil Dawes d5da6a3d58 Dev checkpoint 2009-09-16 08:16:25 +01:00
Phil Dawes fb9f9ac3d3 moved callstack.hpp inline functions to vm.hpp 2009-09-16 08:16:23 +01:00
Phil Dawes a6c3c1e7d2 moved callstack.hpp functions to vm 2009-09-16 08:16:23 +01:00
Phil Dawes a2f14b5a6d added vm member to gc_root and growable arrays 2009-09-16 08:16:22 +01:00
Philipp Brüschweiler 230061783a misc small documentation fixes, some fixes for factor.vim, changed permissions of vm/* to 644 2009-08-10 21:33:07 +02:00
Slava Pestov 610b276c86 callstack>array primitive was not GC safe 2009-05-20 18:52:21 -05:00
Slava Pestov 69cb3dee5e Fix FEP if there are too many words in the image, clean up some VM code 2009-05-13 00:58:54 -05:00
Slava Pestov 3bf8134476 VM cleanup: replace some #defines with constants and inline functions 2009-05-08 15:05:55 -05:00
Slava Pestov 029d93a838 Make walker work better with call( and breakpoints which are nested inside combinators 2009-05-05 09:12:32 -05:00
Slava Pestov 8872c40b1e The great type renaming 2009-05-04 04:50:24 -05:00
Slava Pestov edecac508e Use C++ namespaces 2009-05-04 01:46:13 -05:00
Slava Pestov 8e17e0a01e VM: use better abstractions for tagged pointers, eliminate get()/set() stuff, clean up array, string, and byte-array element access 2009-05-04 01:00:30 -05:00