Commit Graph

75 Commits (174314dafacc9039fc9ff112181c52db25b4725d)

Author SHA1 Message Date
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 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
Slava Pestov f4c0ffb143 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 a08295d9b7 GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov adeb6fb68f vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Doug Coleman 8c492088a2 Fix spaces that crept into vm/ cpp files 2010-02-06 01:06:26 -06: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 a942e2c34d 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 31a260b74c 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 705360e1de vm: grow the heap if a full collection doesn't reclaim enough space 2009-12-05 19:03:53 -05:00
Slava Pestov cc7dea4ce1 vm: be more eager to do a full collection to avoid fragmentation leading to heap growth 2009-12-04 03:41:19 -05: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 bd76bcd52b vm: fix problem in card marking if first block is free 2009-11-16 00:52:32 -06:00
Slava Pestov 4168ffbcee New identity-hashcode primitive 2009-11-10 21:18:54 -06:00
Slava Pestov 2f8ba13da0 vm: faster data_root and <array> primitive 2009-11-06 05:30:37 -06:00
Slava Pestov e3d2f4dbfb vm: report true size of mark stack 2009-11-06 04:15:55 -06:00
Slava Pestov 3e112981b9 vm: fix crash if all-instances primitive triggers a GC 2009-11-06 01:41:11 -06:00
Slava Pestov 7c0c2fec47 vm: restructure data_roots so that its a sequence of handle/len pairs rather than just handles, use it in inline_gc() and all_instances() so that we don't run out of heap while building the object array 2009-11-06 00:54:28 -06:00
Slava Pestov 065dac3736 vm: simpler object space implementation. begin-scan/next-object/end-scan primitives replaced by a single all-instances primitive 2009-11-05 21:49:03 -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 f2bf46e516 vm: fix issue with unnecessary heap growth 2009-11-03 22:25:22 -06:00
Slava Pestov c7430d74c2 vm: remove promotion strategy, clean up compaction code 2009-11-01 03:47:09 -06:00
Slava Pestov 99e3b9c59c vm: don't do a data compaction when growing the data heap, speeds up data heap grow by a bit 2009-10-31 21:06:34 -05: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 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 c429faf310 vm: fix 'data-room' primitive to report correct sizes for tenured space 2009-10-24 23:49:33 -05:00
Slava Pestov 38df6426de vm: move binary_payload_start() method from factor_vm to object class 2009-10-24 04:27:45 -05:00
Slava Pestov 6ee56ca93a vm: use iostreams instead of printf for debug messages, clean up a few things 2009-10-21 20:12:57 -05:00
Slava Pestov 2bae20cd41 vm: debugging mark-sweep 2009-10-21 19:41:54 -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
Slava Pestov 1f97169c62 vm: move factor_vm::untagged_object_size() to object::size() 2009-10-20 13:13:39 -05:00
Slava Pestov f442d1949b Change data heap alignment to 16 bytes 2009-10-20 12:45:00 -05:00
Slava Pestov f0a1a3ce5b vm: rename F to false_object, and rename T to true_object 2009-10-18 20:26:21 -05:00
Slava Pestov c80b255885 vm: allocate stacks and data heap segments without execute permissions 2009-10-16 05:16:12 -05:00
Slava Pestov 1ee53d04a9 vm: new card marking implementation supports marking partial objects 2009-10-13 21:16:04 -05:00
Slava Pestov c9e1d415fe vm: refactoring card logic a bit 2009-10-09 11:16:18 -05:00
Slava Pestov 44c78493bf vm: misc cleanups 2009-10-09 03:20:50 -05:00
Slava Pestov 83de156992 vm: working on new object-oriented garbage collector 2009-10-07 15:48:09 -05:00
Slava Pestov b9f386c693 vm: make a new old_space type to encapsulate a few things, split up generations array somewhat 2009-10-07 14:05:09 -05:00
Slava Pestov bc691eb198 vm: replace generations array with individual instance variables referencing zone objects 2009-10-07 11:59:59 -05:00
Slava Pestov 8ffd538d27 vm: more code cleanups 2009-10-07 08:33:54 -05:00
Slava Pestov 8109e7376c vm: simplify some code 2009-10-06 08:55:42 -05:00
Slava Pestov 326952e919 vm: number of generations is not configurable anymore, split up begin_gc() and end_gc() into collect_{nursery,aging,aging_again,tenured}() 2009-10-06 02:39:12 -05:00
Slava Pestov 3887292543 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