Commit Graph

84 Commits (clean-macosx-x86-64)

Author SHA1 Message Date
Björn Lindqvist 2308ca06e0 Revert "VM: undoing 22bb0cfecf (#1513)"
This reverts commit e9c72baf2e.
2016-11-07 23:43:50 +01:00
Björn Lindqvist e9c72baf2e VM: undoing 22bb0cfecf (#1513) 2016-11-07 14:18:10 +01:00
Björn Lindqvist ffab2bb7e0 VM: code_block::optimized_p() method isn't needed 2016-10-31 14:18:39 +01:00
Björn Lindqvist 453eca66c4 VM: changing case of code_block_type 2016-10-19 09:14:58 +02:00
Björn Lindqvist 026b626203 VM: move allot_code_block() to the allot.hpp file 2016-10-17 08:03:48 +02:00
Björn Lindqvist ac44f3069a VM: indent comment and change error message 2016-10-08 07:13:08 +02:00
Björn Lindqvist c2f4fdb172 VM: merge of the free_list and free_list_allocator classes
Seem simpler to have all the free list stuff in one class rather than
split it over two classes.
2016-10-08 07:04:28 +02:00
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Björn Lindqvist 33d5ecefd5 VM: refactor a struct into a c++11 lambda 2016-06-07 14:04:28 +02:00
Björn Lindqvist 3b016bc254 VM: a bunch of more methods on the factor_vm class that can be made into funtions 2016-05-30 07:44:26 +02:00
Björn Lindqvist c55af9b957 VM: object_size, compute_entry_point_address, code_block_owner made into
functions

It is to make the vm class less heavy
2016-04-24 14:45:03 +02:00
Björn Lindqvist 7da72ac77c VM: the compute_vm_address method can be removed 2015-12-13 13:56:36 +01:00
Björn Lindqvist 46bfcbf3a2 VM: the rel_type() and rel_offset() accessors in instruction_operand can be removed 2015-12-13 13:56:36 +01:00
Björn Lindqvist 22bb0cfecf VM: fixes to use the TAG macro over tagged<object>(obj).type() 2015-11-23 02:27:22 +01:00
Björn Lindqvist bc7f9ee669 VM: always use undecorated names when loading ffi functions
For win32, Factor tries four different function names when loading
stdcall and fastcall functions, in case decorated names are used in the
dll. It seems to not be necessary because a dll meant for 3rd party use
will always export undecorated
names (http://blogs.msdn.com/b/oldnewthing/archive/2004/01/12/57833.aspx).
2015-09-02 21:54:41 +02:00
Björn Lindqvist 22887c5816 VM: get rid of the odd RT_EXCEPTION_HANDLER relocation
The address to the win32 relocation handler can be stored in a special
object and be accessed by jit-install-seh. Doing it that way is better
because you can remove a lot of special code related to that relocation
type.
2015-09-02 21:54:30 +02:00
Björn Lindqvist 56ddb59b00 VM: new function set_memory_locked(true/false)
it wraps the mprotect/VirtualProtect platform differences and makes it
so you can unify some windows/unix code path forks
2015-08-24 07:23:40 -07:00
Björn Lindqvist 4efef7bfd9 VM: merge the compute_dlsym_toc_address() with the
compute_dlsym_address() method

it makes the code slightly more cluttered but you get rid of a lot of
special casing for the ppc platform
2015-08-23 18:36:31 -07: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 5d7fb5da60 VM: smaller style-fixes, like removing redundant else clauses and this prefixes 2015-08-14 20:19:55 -07:00
Björn Lindqvist 49a406d880 VM: using compute_external_address everywhere instead of store_external_address 2015-08-04 16:02:09 +02:00
Björn Lindqvist 50318a6f77 VM: new method compute_external_address 2015-08-04 16:02:08 +02: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 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