Commit Graph

48 Commits (17ed7981787cef51d5a0706d6a1950374e2421ef)

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 c646db3ae5 VM: fixing small style issues
Like aligning comments and changing //-comments to /* */
2016-07-02 15:50:59 +02:00
Björn Lindqvist 81057c4108 VM: the context_object_count must be wrong, there are only 4 of them 2015-08-14 20:19:50 -07:00
Doug Coleman dcc1e7773f contexts.hpp: Increase callstack reserve space to 16k for Mac64. Fixes issue #1419. 2015-08-04 12:43:24 -07:00
John Benediktsson 5c0d8c7e4f vm: minor fixes. 2015-08-04 07:49:50 -07:00
Björn Lindqvist 6fedb79c73 VM: bump stack_reserved from 1kb to 4kb
The added test case fails with a doulbe fault, which appears to be
caused by a stack overflow in the code that tries to handle the stack
overflow. So bumping it to 4096 bytes should give the code enough stack
space to play with.
2015-08-04 16:02:10 +02:00
Björn Lindqvist a7757eed41 VM: new method context::address_to_error 2015-08-04 16:02:10 +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 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 9bfc43144e VM: debug macros FACTOR_PRINT and FACTOR_PRINT_MARK to make better debug
printing messages than just using std::cout
2015-05-09 20:04:21 -07: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
Erik Charlebois 2a5126e49a VM: Refactor contexts to Factor style 2013-05-12 13:24:42 -04:00
Joe Groff 604ceb957c vm: replace remaining stack_frame-based logic 2011-12-14 09:56:49 -08:00
Joe Groff 40bc8459db vm: bottom_frame method for contexts
ctx->callstack_bottom - 1 -- the fuck does that mean?!
2011-11-02 13:23:07 -07:00
Joe Groff 186bf65a00 constants for special object hardcoded literals 2011-11-02 12:54:50 -07:00
Slava Pestov daf40ea0c6 Fix infinite loop and empty-dlist error when an error is thrown from a callback running in a thread other than the initial thread. This addresses part of issue #92 2011-10-02 21:59:09 -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 806e54630a GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov 91cd3b854d Use ##local-allot to simplify longlong unboxing 2010-05-19 01:07:22 -04:00
Slava Pestov eb802208d1 FFI rewrite part 4: parameter and return value unboxing redesign 2010-05-11 19:11:44 -04:00
Slava Pestov de4343eaf7 vm: re-organize context structure 2010-04-02 15:42:29 -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 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 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 9705768e3f vm: remove DEFPUSHPOP macro 2009-12-04 20:56:48 -05:00
Slava Pestov cb6552ae6e vm/contexts: cleanup 2009-11-08 19:44:18 -06:00
Slava Pestov 810e309e0c vm: rename userenv to special_objects 2009-10-23 00:33:53 -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 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 9b7412b8f8 Moved PRIMITIVE and PRIMITIVE_FORWARDs to primitives.[ch]pp 2009-09-27 19:42:18 +01:00
Phil Dawes 83b0769eef renamed factorvm to factor_vm 2009-09-24 08:16:52 +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
Phil Dawes 25bbca2f66 removed save_stacks global function 2009-09-16 08:16:30 +01:00
Phil Dawes 2e81b174a7 removed some stub functions from contexts 2009-09-16 08:16:25 +01:00
Phil Dawes 8fa607e9a9 Dev checkpoint 2009-09-16 08:16:25 +01:00
Phil Dawes 80716a1b6e moved global state from contexts and run into vm
Also renamed template type from T to TYPE to prevent clash with vm::T (true)
2009-09-16 08:16:24 +01:00
Slava Pestov 53db9d737a Change (void) to () 2009-05-05 11:33:35 -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