Commit Graph

99 Commits (b40d68017d99d1c8f823c0d816f5c2baba82a027)

Author SHA1 Message Date
Joe Groff e877ccfb37 vm: cleanups 2011-12-14 09:56:50 -08:00
Joe Groff c339bb9ccf vm: fix types after rebase 2011-12-14 09:56:49 -08:00
Joe Groff 841600fc6e 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 45ed3c4a56 vm: make all_blocks a set of cells
gcc was doing bad things assuming the pointer given to upper_bound was aligned
2011-12-14 09:56:46 -08:00
Joe Groff 12c569e3a7 vm: verifier shouldn't check for leftovers
It doesn't work after things have been freed
2011-12-14 09:56:45 -08:00
Joe Groff 9186a1bdf3 vm: store stack frame size in code blocks
Change modify-code-heap primitive so it takes a sixth element in each array for the frame size.
2011-12-14 09:56:45 -08:00
Joe Groff 06a87c41d6 vm: erase code blocks from all_blocks during sweep
Fixes #437
2011-12-13 12:28:09 -08:00
Joe Groff 8f8873c859 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 857b52401c vm: only verify all_blocks set if it's invalid
Verifying on every sample is way too slow to be practical when debugging bootstrap.
2011-12-12 19:04:56 -08:00
Joe Groff f4a7afdc2d vm: verify code heap's all_blocks set when DEBUG 2011-11-23 11:11:27 -08:00
Joe Groff 00f00663ad 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 55115d7971 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 0d8cf08ea0 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 5b43301eb6 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 09088ec3ce cleanups from code review 2011-10-27 21:18:23 -07:00
Joe Groff e36bb86f26 vm: code_block_for_address method -> code_heap 2011-10-27 21:18:20 -07:00
Joe Groff 011ce33068 vm: Revert extra canary page before callstack
This reverts commit 7d5c8d6990385b94569116a23163d7e75ae21f49. We pretty much can't avoid unwinding frames without some more drastic redesign.
2011-10-27 21:14:50 -07:00
Joe Groff ed72d57c1a vm: allocate an extra canary page before callstack
This will let us safely unguard the callstack overflow guard page as a grace page so the callstack overflow handler can do its business without discarding frames.
2011-10-27 21:14:49 -07:00
Joe Groff d2199b5b21 vm: take a page from code_heap for safepoints 2011-10-27 21:14:44 -07:00
Doug Coleman 43624e037c Squashed commit of the following:
commit 197dbe9a6733775ac0ea19b3da4bd4dc3c85418c
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Sat Sep 18 19:01:38 2010 -0500

    Fix bootstrap, move privileges to windows.privileges

commit 521c622f8afb15bf42d263c738cb990560dc29cb
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Sat Sep 18 18:26:30 2010 -0500

    Hopefully fix bootstrap

commit eb3f22928b59758b9505430034044b5b94705da2
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Sat Sep 18 18:19:05 2010 -0500

    Remove wince from factor codebase

commit 619d6c99415f46208a7ede6a04b0ccda46b15360
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Sat Sep 18 16:07:46 2010 -0500

    Remove Windows CE from vm/
2010-09-19 19:13:25 -05:00
Slava Pestov 0abdfbfc1b compiler.cfg: open-code parameter boxing and unboxing for certain C types 2010-07-19 10:25:13 -04:00
Slava Pestov 1f2f72de5e vm: implement frame-based SEH for 64-bit Windows 2010-04-08 10:32:14 -07:00
Slava Pestov 310399995e Add code heap introspection primitive to VM, and make a code-blocks word in tools.memory that wraps a useful interface around this. Add a lookup-return-address word and use this in tools.disassembler.utils 2010-02-03 23:11:32 +13:00
Slava Pestov d19709c188 vm: modify-code-heap primitive now takes a pair of parameters, update-existing? and reset-pics?. If no generic words were changed, PICs do not need to be reset. If no existing words were redefined, the code heap doesn't have to be traced at all. Speeds up compilation of PEGs since those create lots of compilation units 2010-02-03 23:11:28 +13:00
Slava Pestov 0165daf56c 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 a942e2c34d vm: eliminating register variables work in progress. Works on x86-32 with non-optimizing compiler 2009-12-19 10:59:56 +13:00
Doug Coleman f749d14e86 fix a couple of warnings on win64 2009-12-13 20:00:02 -06:00
Slava Pestov 5180f80180 Get modify-code-heap working if stack traces are stripped (but then it won't update existing code blocks), and rename code_heap::code_heap_free() to code_heap::free() 2009-12-02 05:27:48 -06:00
Slava Pestov 912b1265fc 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 ca7bca6738 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 a684164783 Fix non-tail recursive inline recursive compilation 2009-11-25 19:12:09 -06:00
Slava Pestov 19835ab32e vm: non-optimizing compiler now compiles word definition quotations with the owner set to the word object 2009-11-24 22:44:04 -06:00
Slava Pestov 3789e75e0c vm: compaction now updates the needs_fixup set 2009-11-24 19:29:59 -06:00
Slava Pestov bfa5340ea8 vm: mark sweep now traces code block references; rename embedded_pointer to instruction_operand 2009-11-23 19:17:12 -06:00
Slava Pestov fa50753d40 vm: remove some dead code 2009-11-05 19:32:26 -06:00
Slava Pestov 9ae5faa14e vm: rewrite 'become' primitive so that it uses a slot visitor instead of GC 2009-11-05 19:03:51 -06:00
Slava Pestov b341527428 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 e2beabf2be vm: new GC policy: mark sweep after N megabytes promoted, mark compact if tenured space cannot fit nursery+aging in one contiguous block. N = 32 on 32-bit and 64 on 64-bit 2009-10-30 02:26:57 -05:00
Slava Pestov 503137b1b9 vm: clean up gc events, remove -verbosegc switch, fix compaction bug 2009-10-27 21:31:28 -05:00
Slava Pestov 61c2ff4fff vm: add primitives for getting at GC events, data-room and code-room primitives now return structs instead of arrays 2009-10-27 03:32:28 -05:00
Slava Pestov 772c5483dc vm: get GC events working, -verbosegc switch now produces more info 2009-10-26 23:57:26 -05:00
Slava Pestov 74ecd90cd6 vm: remove crummy old GC stats, split off free list code, clean up various other things 2009-10-26 22:08:35 -05:00
Slava Pestov d3dede5599 vm: room. now prints mark stack size, and total/contiguous free space 2009-10-25 13:18:06 -05:00
Slava Pestov 074200a213 vm: make some more ctors explicit just for kicks 2009-10-24 23:02:58 -05:00
Slava Pestov 7142274aef vm: combine heap_block and code_block structs, eliminates some boilerplate 2009-10-24 21:33:31 -05:00
Slava Pestov 60f3cb669a vm: data heap compaction work in progress 2009-10-24 04:18:33 -05:00
Slava Pestov eefcc0fb8c vm: factor out code that visits object slots and code heap blocks into slot_visitor and code_block_visitor 2009-10-24 03:54:53 -05:00
Slava Pestov a03a817bdb vm: mark sweep gc for tenured space work in progress 2009-10-20 22:20:49 -05:00
Slava Pestov 056ccc6741 vm: split off free_list_allocator from heap class, rename zone to bump_allocator 2009-10-20 15:26:11 -05:00
Slava Pestov e7d707c92c vm: simplify code heap by eliminating HeapLayout template parameter 2009-10-20 14:01:46 -05:00