Doug Coleman
c675694619
vm: Annotate more places where we can gc.
...
Code formatting fix.
2014-11-29 19:25:46 -06:00
Doug Coleman
19685f4528
vm: jit::jit is a c++ constructor but it does not allocate objects to the Factor heaps.
...
Add annotations for gc allocating.
2014-02-14 20:29:26 -08:00
Erik Charlebois
ffe41b3d7f
VM: Fixup cast formatting after clang-format
...
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
2013-05-13 14:59:24 -04:00
Erik Charlebois
7b1b1eef23
VM: Remove unnecessary _ suffix in constructors
2013-05-12 23:20:43 -04:00
Erik Charlebois
2e20733ade
VM: Refactor callstack to Factor style
2013-05-12 13:24:42 -04:00
Erik Charlebois
ca2ea548be
VM: Remove exec bit from VM source files
2013-05-11 17:04:23 -04:00
John Benediktsson
5be15d7e3f
vm: more use of ctx->replace().
2013-03-22 09:17:02 -07:00
Joe Groff
842eb27785
vm: cleanups
2011-12-14 09:56:50 -08:00
Joe Groff
a1ee881435
vm: get rid of now-trivial innermost_stack_frame
2011-12-14 09:56:49 -08:00
Joe Groff
604ceb957c
vm: replace remaining stack_frame-based logic
2011-12-14 09:56:49 -08:00
Joe Groff
d74f194b07
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
a1958c67bd
vm: callstack_reversed for callstack_to_array
2011-12-14 09:56:48 -08:00
Joe Groff
d12b6e375b
vm: iterate_callstack_reversed in slot_visitor
2011-12-14 09:56:47 -08:00
Joe Groff
e116bc497b
vm: reversed callstack iteration
2011-12-14 09:56:47 -08:00
Joe Groff
5b9aee2c91
vm: don't suffer null return addresses
2011-12-14 09:56:46 -08: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
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
5d59faa7d1
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
a6b80f3efa
vm: code_block_for_address method -> code_heap
2011-10-27 21:18:20 -07:00
Joe Groff
03ebb91170
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
11ffea55fc
vm: sniff leaf words walking code heap, not data
2011-10-27 21:18:19 -07:00
Joe Groff
126bf22c16
vm: include quots and profile stubs in leaf search
2011-10-27 21:18:19 -07:00
Joe Groff
ff2d480d98
cpu.x86.32: update for resumable signal handlers
2011-10-27 21:18:19 -07:00
Joe Groff
7bd7d0234d
vm: turns out adding and subtracting are different
2011-10-27 21:18:19 -07:00
Joe Groff
f284ac2b48
vm: fix foreign segfaults and callstack overflows
2011-10-27 21:18:18 -07:00
Joe Groff
402e1155a5
vm: resumably handle signals from leaf procedures
2011-10-27 21:18:18 -07:00
Joe Groff
1386212d23
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
a374c2da05
vm: sketchy signal dispatch from leaf procs
2011-10-27 21:14:49 -07:00
Joe Groff
6e4117035e
vm: factor out dispatch_signal_handler logic
2011-10-27 21:14:49 -07:00
Joe Groff
1dc31d133b
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
10845ebfb9
callstack.cpp: fix fat-fingered typo from undefined-symbol change
2011-09-12 23:15:09 -07:00
Slava Pestov
7c3827190b
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
e8b1a06dad
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
d74817cedf
vm: Remove signal_callstack_top nonsense
2010-09-02 22:57:17 -05:00
Slava Pestov
1818bcb780
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
70b8a74208
vm: have to be extra careful when messing with return addresses
2010-06-13 18:12:57 -04:00
Slava Pestov
3f28c0e7f5
vm: context switching needs to scrub the return address
2010-06-12 19:54:31 -04:00
Slava Pestov
806e54630a
GC maps for more compact inline GC checks
2010-06-11 20:06:00 -04:00
Doug Coleman
366ce2896f
Add callstack-bounds primitive to vm/ for use with javascriptcore library
2010-04-19 20:08:15 -05:00
Slava Pestov
216a05e68a
vm: small cleanup
2010-04-13 21:24:42 -07: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
560c119cd2
vm: actually use context callstacks when running code
2010-03-26 22:44:43 -04:00
Slava Pestov
fbf078d4b3
words: undefined error now contains the word in question
2010-02-03 23:11:23 +13:00
Slava Pestov
637a77c018
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
36d2ac8921
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
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
0068bce934
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
9963d265ba
vm: fix walker
2009-12-02 18:43:45 -05:00
Slava Pestov
4ebaf956c3
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