Joe Groff
45ed3c4a56
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
14e0c9f482
vm: pack frame size into code block header bits
2011-12-14 09:56:45 -08:00
Joe Groff
9186a1bdf3
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
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
0d8cf08ea0
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
5b8bc33311
vm: add RT_SAFEPOINT relocation type
2011-10-27 21:14:44 -07:00
Slava Pestov
b1b7b24ad5
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
e129c13a92
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
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
Erik Charlebois
1ed2bc6231
32 and 64 bit Linux PPC support
2011-05-23 23:36:14 -04:00
Slava Pestov
7f0469efef
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
90b945eaa0
compiler: add ##load-vector instruction to avoid wasting a temporary register on x86-32
2010-05-03 17:34:28 -04:00
Slava Pestov
1d7089dc04
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
e70a5a8cfc
vm: fix compile error
2010-04-04 13:53:17 -05:00
Slava Pestov
cdc4fb3b62
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
370718e9a4
vm: signal handling cleanup
2010-03-27 07:33:28 -04:00
Slava Pestov
ba61398145
vm: clean up TLS usage
2010-03-27 03:44:40 -04:00
Slava Pestov
d19709c188
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
0e0b750e7d
Update Win64 support
2010-01-25 15:39:34 +13:00
Slava Pestov
88004434ec
vm: remove primitive table, non-optimizing compiler now looks up primitives with dlsym()
2010-01-19 20:00:33 +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
edb1346239
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
72311506d2
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
c6c351ffb0
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
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
5180f80180
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
daf47a539c
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
912b1265fc
Split literal table into literal and parameter tables, literal table is discarded after code block initialization
2009-12-02 04:28:15 -06:00
Slava Pestov
8a25e8365a
vm: Clean up more code duplication and rename a few methods
2009-12-02 01:17:30 -06:00
Slava Pestov
5533a43a86
vm: factor out common code between image loading and initial code block relocation
2009-12-02 00:54:16 -06:00
Slava Pestov
ca7bca6738
Big cleanup of literal table and relocation-related code
...
- new way to iterate over instruction_operands cleans up relocation code
- move some methods out of the VM class to clean up code
- if debugging is on, die earlier if attempting to allocate inside GC
- callback heap entries are now code_blocks
- replace block_granularity with data_alignment
2009-12-02 00:48:41 -06:00
Slava Pestov
8d41693ee3
vm: growing heap no longer uses relocate_code_block()
2009-11-28 19:48:26 -06:00
Slava Pestov
3d335474fe
vm: new image relocation that doesn't use literal table
2009-11-27 17:05:08 -06:00
Slava Pestov
0ac2a92d56
vm: new implementation of modify-code-heap that doesn't use literal tables
2009-11-25 17:20:48 -06:00
Slava Pestov
0521890f97
vm: flush icache after GC
2009-11-24 21:36:35 -06:00
Slava Pestov
49727354d1
vm: deallocate old PIC after allocating the new one to avoid having the code heap potentially point to a free block during compaction
2009-11-24 21:20:23 -06:00
Slava Pestov
3789e75e0c
vm: compaction now updates the needs_fixup set
2009-11-24 19:29:59 -06:00
Slava Pestov
bfa5340ea8
vm: mark sweep now traces code block references; rename embedded_pointer to instruction_operand
2009-11-23 19:17:12 -06:00
Slava Pestov
e66b8673f4
vm: minor GC traces embedded pointers
2009-11-22 13:37:39 -06:00
Slava Pestov
c434201b33
vm: eliminating literal table work in progress
2009-11-07 16:16:09 -06:00