Commit Graph

79 Commits (2c67a5cd78e5dcffd7146e6fd0eb95f810a497e1)

Author SHA1 Message Date
John Benediktsson e94b56c2c7 vm: more use of ctx->replace(). 2013-03-22 09:17:02 -07:00
Joe Groff e877ccfb37 vm: cleanups 2011-12-14 09:56:50 -08:00
Joe Groff 530db5fa95 vm: get rid of now-trivial innermost_stack_frame 2011-12-14 09:56:49 -08:00
Joe Groff e56f2b5753 vm: replace remaining stack_frame-based logic 2011-12-14 09:56:49 -08:00
Joe Groff 9df2c107dc vm: remove _reversed from callstack iterator names
Now that they're the only game in town we can give them the short names
2011-12-14 09:56:49 -08:00
Joe Groff 1ef3454e1a vm: callstack_reversed for callstack_to_array 2011-12-14 09:56:48 -08:00
Joe Groff 00967b4931 vm: iterate_callstack_reversed in slot_visitor 2011-12-14 09:56:47 -08:00
Joe Groff 41f3190349 vm: reversed callstack iteration 2011-12-14 09:56:47 -08:00
Joe Groff 9bdeac9745 vm: don't suffer null return addresses 2011-12-14 09:56:46 -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 29e652f67e 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 e431cef96b vm: move dispatch_signal_handler to cpu-x86.cpp
The new signal handler dispatch is logic is CISC-centric; defer fixing it until we find someone who cares
2011-10-27 21:18:20 -07:00
Joe Groff e36bb86f26 vm: code_block_for_address method -> code_heap 2011-10-27 21:18:20 -07:00
Joe Groff 1660bd5a19 vm: remove signal_from_leaf flag
Now that the resuming from the signal handler works within leaf procedures, the flag is no longer necessary.
2011-10-27 21:18:20 -07:00
Joe Groff 3e3be77d07 vm: sniff leaf words walking code heap, not data 2011-10-27 21:18:19 -07:00
Joe Groff fa37ddcdf9 vm: include quots and profile stubs in leaf search 2011-10-27 21:18:19 -07:00
Joe Groff 66ffd0f138 cpu.x86.32: update for resumable signal handlers 2011-10-27 21:18:19 -07:00
Joe Groff c049fa4a46 vm: turns out adding and subtracting are different 2011-10-27 21:18:19 -07:00
Joe Groff a5da58bb97 vm: fix foreign segfaults and callstack overflows 2011-10-27 21:18:18 -07:00
Joe Groff 1eddaf34f1 vm: resumably handle signals from leaf procedures 2011-10-27 21:18:18 -07:00
Joe Groff cb6f175ef8 vm: dispatch signal handlers through subprimitive
We also need to save C ABI volatile registers before calling the signal handler in order to be able to reliably resume. Add signal-handler and leaf-signal-handler subprimitives to preserve volatile registers before invoking the signal handler C function.
2011-10-27 21:18:18 -07:00
Joe Groff f788bc954c vm: sketchy signal dispatch from leaf procs 2011-10-27 21:14:49 -07:00
Joe Groff f759575ddd vm: factor out dispatch_signal_handler logic 2011-10-27 21:14:49 -07:00
Joe Groff 01b782e6c4 vm: clean up signal handler dispatch
Remove the weird and broken functions fix_callstack_top and scrub_return_address. Instead, simply decrement the SP and store the PC from the front end of the signal handler so that the back end can return back into the original context normally. Currently aborts for leaf procedure frames pending a more robust solution.
2011-10-27 21:14:48 -07:00
Slava Pestov 6259a50243 callstack.cpp: fix fat-fingered typo from undefined-symbol change 2011-09-12 23:15:09 -07:00
Slava Pestov 20c6aaddec Tease out symbol name and library in undefined_symbol() handler, for friendlier errors when calling an unresolved C function name. Fixes #93 2011-09-12 00:56:24 -07:00
Slava Pestov 05fc6ddad6 vm: a stack underflow inside a primitive could leave a data root in an uninitialized state; if allocating the thrown underflow error triggered a GC, the GC would visit a garbage pointer 2010-09-17 19:46:57 -07:00
Slava Pestov 55ac874eb2 vm: Remove signal_callstack_top nonsense 2010-09-02 22:57:17 -05:00
Slava Pestov 6617eca683 Fix three problems discovered by running math.floats.env tests in a loop:
- Crash if allocating error triggers a GC from a signal/SEH handler
- Crash if GC runs with floating point traps enabled on Windows
- Floating point traps didn't prettyprint properly
2010-09-02 22:57:14 -05:00
Slava Pestov 5e39764ccd vm: have to be extra careful when messing with return addresses 2010-06-13 18:12:57 -04:00
Slava Pestov d91524b98d vm: context switching needs to scrub the return address 2010-06-12 19:54:31 -04:00
Slava Pestov a08295d9b7 GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Doug Coleman c78628fbe9 Add callstack-bounds primitive to vm/ for use with javascriptcore library 2010-04-19 20:08:15 -05:00
Slava Pestov b621d1cd7c vm: small cleanup 2010-04-13 21:24:42 -07:00
Slava Pestov cea2bf4189 threads: use context-switching primitives 2010-03-29 20:40:17 -04:00
Slava Pestov 370718e9a4 vm: signal handling cleanup 2010-03-27 07:33:28 -04:00
Slava Pestov adeb6fb68f vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Slava Pestov 7fa61addcd words: undefined error now contains the word in question 2010-02-03 23:11:23 +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 d2baa6dde5 vm: move c_to_factor, lazy_jit_compile_impl, throw_impl, set_callstack assembly routines into non-optimizing compiler for x86-64 2010-01-06 15:47:36 +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 f50e144288 vm: fix walker 2009-12-02 18:43:45 -05: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 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 fad52e8420 vm: fix crash when converting a callstack to an array 2009-10-20 12:19:02 -05:00
Slava Pestov 89612b7f31 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 f0a1a3ce5b vm: rename F to false_object, and rename T to true_object 2009-10-18 20:26:21 -05:00
Slava Pestov 030d035e94 vm: code heap compaction at runtime using compact-gc primitive 2009-10-16 11:39:35 -05:00
Phil Dawes 0b2db4018a Removed VM_PTR macros. All builds reentrant by default 2009-10-14 19:14:57 +01:00