Doug Coleman
2a409c79e0
vm: Fix unused variable warnings on Windows.
2018-07-13 00:48:58 -05:00
Doug Coleman
aa87e69d25
Revert "VM: removing the unused callstack-bounds primitive"
...
This reverts commit c55a6ef873
.
This primitive is useful for fixing the macOS pthread bug and the javascriptcore library.
2018-06-03 22:12:28 -05:00
Björn Lindqvist
4737645857
VM: this struct isn't used anymore
2016-12-15 00:29:37 +01:00
Björn Lindqvist
c55a6ef873
VM: removing the unused callstack-bounds primitive
...
Probably needs new boot images
2016-11-21 22:30:20 +01:00
Björn Lindqvist
0b6ffdc77e
Revert "VM: undoing 0274e889b9
( #1513 )"
...
This reverts commit a4802aba68
.
2016-11-09 02:07:56 +01:00
Björn Lindqvist
a4802aba68
VM: undoing 0274e889b9
( #1513 )
2016-11-08 13:37:52 +01:00
Björn Lindqvist
46105b62f6
VM: change callstack>array primitive so it doesn't reverse anymore
...
This fixes one part of the #452 bug.
2016-10-13 01:34:55 +02:00
Alexander Iljin
0d57734dab
vm: replace block comments /**/ with line comments //
2016-09-09 05:47:52 +02:00
Björn Lindqvist
0274e889b9
VM: refactor tagged.hpp so it's not dependent on the factor_vm class
...
this way untag<byte_array>(relocation) can be used in code_blocks.hpp
2015-11-24 16:00:50 +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
2b1c6ca11a
VM: move the frame_predecessor() method to the code_heap class
2015-08-14 20:19:54 -07:00
John Benediktsson
4c2c8f133f
vm: rename some primitives, and some cleanup.
...
* quot-compiled? => quotation-compiled?
* optimized? => word-optimized?
2015-07-15 11:13:52 -07:00
Björn Lindqvist
4bc0720e51
VM: more changes of structs to lambda functions
2015-07-06 22:49:38 +02:00
Björn Lindqvist
fb9fa12cdd
VM: change the definition of entry_point in word and quotation from void* to cell
...
this gets rid of lots of redundant casts from void* to cell
2015-01-15 09:29:13 +00:00
Björn Lindqvist
af270cb4d8
VM converts the methods callstack::frame_top_at and code_block::offset to use cells instead of void*'s
2015-01-15 09:29:13 +00:00
Björn Lindqvist
eb7a5ab1ba
VM: some more fixing to make the types match better, converting void* to cell
2015-01-15 09:29:13 +00: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
Björn Lindqvist
a6e191a490
VM: the frame_return_address and set_frame_return_address functions aren't needed (clearer to read/write the pointers directly)
2015-01-15 09:29:13 +00:00
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