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
f5dc4afb2e
VM: better error message in case factor_vm::store_external_address fails
2015-01-28 14:58:22 +00: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
Björn Lindqvist
11e906139b
VM: code_block::scan, make it so the method always returns -1 if scan can't be determined, part of the fix for #1265
2015-01-15 09:29:13 +00:00
Doug Coleman
57611f78d3
code_blocks: Same error message in two places, make it clear which is triggering.
2014-05-07 14:02:14 -07: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
b918c3e646
VM: Remove redundant #ifdef FACTOR_DEBUGs
...
FACTOR_DEBUG checks around asserts aren't needed, since FACTOR_ASSERT is
already conditionally defined by FACTOR_DEBUG.
2013-05-12 23:44:32 -04:00
Erik Charlebois
7b1b1eef23
VM: Remove unnecessary _ suffix in constructors
2013-05-12 23:20:43 -04:00
Erik Charlebois
26ff071205
VM: Remove unnecessary explicit keywords
2013-05-12 21:48:38 -04:00
Erik Charlebois
d2fe86eb7e
VM: Refactor code_blocks 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
Doug Coleman
2b33dde782
vm: Add more Allocates memory comments.
2013-03-25 17:52:30 -07:00
Joe Groff
b094d4d0ec
vm: actually code_block_pic is a fine frame type
2011-12-21 21:12:54 -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
a1958c67bd
vm: callstack_reversed for callstack_to_array
2011-12-14 09:56:48 -08:00
Joe Groff
e116bc497b
vm: reversed callstack iteration
2011-12-14 09:56:47 -08:00
Joe Groff
3868895b56
vm: make all_blocks a set of cells
...
gcc was doing bad things assuming the pointer given to upper_bound was aligned
2011-12-14 09:56:46 -08:00
Joe Groff
d6227c182b
vm: pack frame size into code block header bits
2011-12-14 09:56:45 -08:00
Joe Groff
e21f316583
vm: store stack frame size in code blocks
...
Change modify-code-heap primitive so it takes a sixth element in each array for the frame size.
2011-12-14 09:56:45 -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
2705fc67cb
vm: keep a set of all code_blocks in the code_heap
...
This way looking up code blocks by return address is an O(log n) set lookup rather than an O(n) linear scan.
2011-11-23 11:11:26 -08:00
Joe Groff
e1465308cd
vm: add RT_SAFEPOINT relocation type
2011-10-27 21:14:44 -07:00
Slava Pestov
f8e475485a
Add RT_INLINE_CACHE_MISS relocation type to avoid frequent dlsym lookups when compiling PICs. Fixes #123
2011-10-03 00:26:21 -07:00
Slava Pestov
bbe369ebfa
Fix undefined-symbol reporting on 32-bit architectures; the return address is exactly at the relocation point in this case
2011-09-13 20:43:07 -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
Erik Charlebois
64252dbdbc
32 and 64 bit Linux PPC support
2011-05-23 23:36:14 -04:00
Slava Pestov
58e4381eb1
compiler: new "binary literal area" at the end of a word's machine code stores constant floats and SIMD vectors; this allows ##load-reference/##load-memory fusion to be performed on x86-64, with a RIP-relative address reaching the data; also simplifies VM since custom relocation types used by the previous 32-bit-only optimization are no longer needed
2010-05-03 17:34:35 -04:00
Slava Pestov
9788323d25
compiler: add ##load-vector instruction to avoid wasting a temporary register on x86-32
2010-05-03 17:34:28 -04:00
Slava Pestov
2517b2fc2b
compiler: combine ##load-constant followed by ##alien-double into a ##load-double on x86-32, saving an integer register
2010-04-18 21:42:45 -05:00
Slava Pestov
d70cf197f2
vm: fix compile error
2010-04-04 13:53:17 -05:00
Slava Pestov
74640b7f71
Get green threads working on Windows
...
- store stack base and limit in TIB
- set up a frame-based structured exception handler in each context's callstack
- boot.x86.32.image has now been replaced by boot.winnt-x86.32.image and boot.unix-x86.32.image
2010-04-03 20:24:33 -04:00
Slava Pestov
11ddbc03a4
vm: signal handling cleanup
2010-03-27 07:33:28 -04:00
Slava Pestov
69bb81dab8
vm: clean up TLS usage
2010-03-27 03:44:40 -04:00
Slava Pestov
3259ef4bec
vm: modify-code-heap primitive now takes a pair of parameters, update-existing? and reset-pics?. If no generic words were changed, PICs do not need to be reset. If no existing words were redefined, the code heap doesn't have to be traced at all. Speeds up compilation of PEGs since those create lots of compilation units
2010-02-03 23:11:28 +13:00
Slava Pestov
942f6e0943
Update Win64 support
2010-01-25 15:39:34 +13:00
Slava Pestov
5606825e8b
vm: remove primitive table, non-optimizing compiler now looks up primitives with dlsym()
2010-01-19 20:00:33 +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
e4da687413
vm: Tweak Factor VM to compile with Microsoft Visual Studio on Windows, in addition to Mingw. Add an Nmakefile which can be used for this purpose. Rename Makefile to GNUmakefile.
2010-01-17 03:43:22 +13:00
Slava Pestov
c04fef10c7
vm: ensure that non-optimized calls to generic words which have not yet been compiled can still work
2010-01-06 23:49:14 +13:00
Slava Pestov
febccd5f62
vm: if an aging GC is triggered while uninitialized code blocks are in the code heap, the code heap remembered set becomes out of date, resulting in code blocks pointing at invalid data
2009-12-22 15:49:21 +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
066d2836ca
Get modify-code-heap working if stack traces are stripped (but then it won't update existing code blocks), and rename code_heap::code_heap_free() to code_heap::free()
2009-12-02 05:27:48 -06:00
Slava Pestov
eb840dcf41
RT_HERE now takes its argument from the literal table rather than the parameter table, reducing image size further
2009-12-02 04:55:48 -06:00
Slava Pestov
68c09f0e93
Split literal table into literal and parameter tables, literal table is discarded after code block initialization
2009-12-02 04:28:15 -06:00