Commit Graph

59 Commits (a43a455990b9fdd6501f06a8e4c921caeaf9e46d)

Author SHA1 Message Date
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
John Benediktsson 70778b89ae Revert "VM: always clear the data and retainstack in general_error because they might contain uninitialized values (#1187)"
This reverts commit 378f208025.
2014-12-04 11:46:28 -08:00
Björn Lindqvist 378f208025 VM: always clear the data and retainstack in general_error because they might contain uninitialized values (#1187) 2014-12-04 10:26:23 -08:00
Doug Coleman c675694619 vm: Annotate more places where we can gc.
Code formatting fix.
2014-11-29 19:25:46 -06: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
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 2a5126e49a VM: Refactor contexts to Factor style 2013-05-12 13:24:42 -04:00
John Benediktsson 5be15d7e3f vm: more use of ctx->replace(). 2013-03-22 09:17:02 -07:00
Doug Coleman aad70160f0 vm: Add more comments about functions that allocate. 2012-08-15 22:00:08 -07:00
Joe Groff 0a1a252cdb 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 dca0fd3487 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 c3f007ce0a 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 794d371444 vm: fix compiler warning 2010-09-27 20:37:37 -07:00
Slava Pestov 6b5fffc026 compiler: preliminary implementation of tracking derived pointers in GC maps 2010-09-27 20:12:44 -07:00
Slava Pestov a36bd7fbaf vm: don't keep more than 10 unused contexts around to prevent address space wastage on low-budget operating systems like OpenBSD 2010-09-17 20:52:27 -07:00
Slava Pestov 451237a028 Fix start-context-and-delete sub-primitive (reported by Sascha Matzke) 2010-08-02 20:28:23 -04:00
Slava Pestov 4aa644a256 vm: fix compile warnings on Windows and add /WX to Nmakefile to report warnings as errors so that mason can catch these in the future 2010-06-17 01:48:39 -04:00
Slava Pestov e86f434f26 Add GC maps to ##box, ##box-long-long, ##alien-invoke, ##alien-indirect and ##call-gc; remove ##gc-map instruction 2010-06-14 19:39:46 -04:00
Slava Pestov 997a7543a9 vm: fix typo 2010-06-11 20:08:52 -04:00
Slava Pestov 806e54630a GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov 0faa3bcf4a vm: pre-allocate context alien 2010-04-02 00:02:21 -04:00
Slava Pestov fb2ecab614 threads: delete old contexts immediately instead of handing them off to a 'context recycler' thread 2010-03-30 21:47:48 -04:00
Slava Pestov c7142e4281 threads: use context-switching primitives 2010-03-29 20:40:17 -04:00
Slava Pestov 11ddbc03a4 vm: signal handling cleanup 2010-03-27 07:33:28 -04:00
Slava Pestov 1717b8d0f7 Implement start-context and set-context primitives 2010-03-27 02:56:11 -04:00
Slava Pestov 560c119cd2 vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Slava Pestov 6aee6b3adc Add context-specific special object table, generalizing catchstack_save and current_callback_save fields of context struct 2010-03-18 22:06:00 +13:00
Slava Pestov ba5b90e063 Change how non-volatile register preservation is done in alien callbacks, with the aim of fixing callbacks on PowerPC, and to eventually eliminate assembly code from VM
- Simplify calculation of offset in relocation table
- Open-code %alien-callback
- Remove magic_frame hack from context objects
- Move magical return instruction from optimizing compiler backend into callback entry stub
2010-01-03 01:11:51 +13:00
Slava Pestov e96404327e Get optimizing compiler working without global register variables in VM 2009-12-22 15:42:49 +13: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 cb6552ae6e vm/contexts: cleanup 2009-11-08 19:44:18 -06:00
Slava Pestov 72ab6ec548 vm: rewrite 'become' primitive so that it uses a slot visitor instead of GC 2009-11-05 19:03:51 -06:00
Slava Pestov 810e309e0c vm: rename userenv to special_objects 2009-10-23 00:33:53 -05:00
Slava Pestov d85d84697a Change data heap alignment to 16 bytes 2009-10-20 12:45:00 -05:00
Slava Pestov 2e65366c6b vm: rename myvm and parent_vm instance variables to parent, clean up casts in primitive definitions 2009-10-18 20:31:59 -05:00
Slava Pestov 236588208b vm: rename F to false_object, and rename T to true_object 2009-10-18 20:26:21 -05:00
Slava Pestov 107c96f642 vm: code heap compaction at runtime using compact-gc primitive 2009-10-16 11:39:35 -05:00
Slava Pestov c04412219b vm: allocate stacks and data heap segments without execute permissions 2009-10-16 05:16:12 -05: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
Phil Dawes 7fef05fd76 Removed VM_PTR macros. All builds reentrant by default 2009-10-14 19:14:57 +01:00
Slava Pestov 5c774d8c84 vm: more code cleanups 2009-10-07 08:33:54 -05:00
Phil Dawes 9b7412b8f8 Moved PRIMITIVE and PRIMITIVE_FORWARDs to primitives.[ch]pp 2009-09-27 19:42:18 +01:00
Slava Pestov f81c8549f4 Make segment, context, data_heap, zone more object-oriented, and fix crash when calling undefined symbols 2009-09-25 21:17:20 -05:00
Phil Dawes 6b7717bf37 forwarding functions replaced with PRIMITIVE_FORWARD() macro 2009-09-25 20:43:01 +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 e3ac531fdb renamed vmprim_ to primitive_ 2009-09-24 08:02:13 +01:00
Phil Dawes 005549ba43 vm pointer passed to nest_stacks and unnest_stacks (win32) 2009-09-16 08:17:26 +01:00
Phil Dawes cdb6304fef Dev checkpoint 2009-09-16 08:17:26 +01:00
Phil Dawes 9a37b6abb6 moved stack_chain into vm struct 2009-09-16 08:16:31 +01:00