Commit Graph

77 Commits (d8ad5b25bdedef35ed9deabba8c427934937dd62)

Author SHA1 Message Date
Björn Lindqvist 3b3cc151e9 VM: removing factor_vm::init_contexts() 2016-11-23 06:42:06 +01:00
Björn Lindqvist 1a646d3379 VM: removing array_to_stack() from the factor_vm class 2016-11-23 06:42:06 +01:00
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Alexander Iljin e0acf4f328 Revert "vm: replace line comments // with block comments /**/ for consintency"
This reverts commit 7ee4e5dea5.
2016-09-09 05:47:52 +02:00
Alexander Iljin 7ee4e5dea5 vm: replace line comments // with block comments /**/ for consintency
Fix #1651.
2016-08-03 09:19:48 -07:00
Björn Lindqvist c646db3ae5 VM: fixing small style issues
Like aligning comments and changing //-comments to /* */
2016-07-02 15:50:59 +02:00
Björn Lindqvist a331ad3788 VM: factor_vm::set_callstack and set_retainstack is not needed 2016-06-27 16:08:58 +02:00
Björn Lindqvist 340ad8b8d9 VM: removes the delete_contexts method 2016-05-14 18:21:49 +02:00
Doug Coleman 67eb64cf00 vm/contexts.cpp: We are only deleting half the contexts because we increment the iter twice per loop! Fixes #1534. Thanks clang! 2016-03-01 00:19:43 -08:00
Björn Lindqvist 1a72f731e0 VM: now special-objects is used for -1, 0, 1 and t
The fields in the image_header aren't read or written to but I haven't
changed the format yet.
2015-12-10 10:22:38 +01:00
Björn Lindqvist a53d5be683 VM: make allot_alien() and ffi_dlsym() use cell instead of void*
this way we get rid of a bunch of superfluous casts
2015-08-23 18:36:31 -07:00
Björn Lindqvist 59b7a50567 VM: removing the get_datastack/retainstack/callstack primitives
they can all be implemented using the
datastack/retainstack/callstack-for primitives and the less primitives
the better!
2015-08-23 18:36:30 -07:00
Björn Lindqvist a7757eed41 VM: new method context::address_to_error 2015-08-04 16:02:10 +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 8e1f3a0e51 VM: after reset_datastack and retainstack clear the stack segment. makes
it easier to find bad accesses to shadow data
2015-05-22 12:22:28 -07:00
Björn Lindqvist 183ec83a6d VM: possible fix for #1319.
Fix for reset_context() so that the top two stack items are never
removed from the stack so if the parent->init_context(ctx) call triggers
a GC, those items are never collected.
2015-05-22 12:22:27 -07:00
Björn Lindqvist 016614747d VM: the delete_context() and reset_context() api functions can be
simplified a bit

The functions always operates on parent->ctx, so passing a context*
parameter is redundant. This enables shorter assembly code for
the (start-context-and-delete) and (set-context-and-delete) primitives.
2015-05-22 12:22:26 -07:00
Björn Lindqvist 6b29c0ea00 VM: refactoring to remove redundancy in retainstack|datastack_to_array 2015-02-28 14:14:30 -08: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
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