Commit Graph

122 Commits (ae9818db874a63399d1fe32ce7425ed2a4451a1d)

Author SHA1 Message Date
Björn Lindqvist b2bb1f8ff4 VM: simplifying the load_image() code 2016-09-16 06:27:46 +02:00
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Björn Lindqvist 7342d97e6d VM: add destructor to vm_parameters so that executable and image_path is
free'd

Valgrind complained that those were leaking
2016-05-14 18:21:49 +02:00
Björn Lindqvist e2b133e291 VM: return value of vm_executable_path() should be free'd 2016-05-14 18:21:49 +02:00
Björn Lindqvist 63791bf90e VM: move some logic from factor_vm to the vm_parameters class
It's good because the factor_vm class is to fat.
2016-05-14 18:21:49 +02:00
Björn Lindqvist 28b5378196 VM: merge of fixup_data & fixup_code into a new method fixup_heaps 2016-04-24 12:42:22 +02:00
Björn Lindqvist 10ac4da0f6 VM: fixes to make some if-else statements read better 2016-03-31 00:37:59 +02:00
Björn Lindqvist 1a72f731e0 VM: now special-objects is used for -1, 0, 1 and t
The fields in the image_header aren't read or written to but I haven't
changed the format yet.
2015-12-10 10:22:38 +01:00
Björn Lindqvist 85784c5265 VM: make save-image throw exception on error (#1090) 2015-09-30 23:31:47 +02:00
Björn Lindqvist 2536b6cd93 VM: fix move_file called from save_image
save_image() shouldn't throw exceptions because if the 'then_die'
argument is t it would leave factor in an inconsistent state. So
therefore move_file() should be fixed and raw_fclose() called instead of
safe_fclose().
2015-09-29 23:13:10 +02:00
Björn Lindqvist 40eb664425 VM: simplified save_image, goto works here! 2015-09-29 23:13:09 +02:00
Björn Lindqvist 03d861976c VM: new method visit_instruction_operands(), it replaces the instruction
operand iteration code in compaction.cpp and image.cpp
2015-08-04 16:02:09 +02: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 b44db91f65 VM: init_code_heap is trivial and only used once, so let's remove it 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 b9b75c272b VM: let's merge (save-image) and (save-image-and-exit) into one 3
arg (save-image). it's good not to have to many similar primitives
2015-07-12 22:36:59 +02:00
Björn Lindqvist c69e1a6e93 VM: move the paths out of gc memory so that they arent unnecessarily
added to the image
2015-07-12 22:36:59 +02:00
Björn Lindqvist 365b39e0cc VM: change lot of visitation objects to use cool lambda functions instead 2015-07-06 22:49:38 +02:00
Doug Coleman 31fe045560 vm: differentiate which strerror is printing the message. 2015-06-08 17:58:00 -07:00
Björn Lindqvist f1ca83524a VM: new functions raw_fclose and raw_fread
These need to be used when the image is loaded because there is no
context so you can't throw io errors yet.
2015-06-05 02:14:49 +02:00
Björn Lindqvist 667e5768ba VM: it's confusing that slot_visitors are called "workhorse" sometimes, let's standardize the name "visitor" 2015-02-28 14:14:29 -08:00
Björn Lindqvist 5490c50217 VM: visit_roots and visit_contexts where always called in tandem, make a new method visit_all_roots that calls them both 2015-02-28 14:14:29 -08:00
Björn Lindqvist 8ea1eea4e1 VM: instead of passing around the trace_contexts_p arg, just clear the contexts in primitive_save_image_and_exit() it has the same effect but is simpler 2015-01-15 09:29:14 +00:00
Björn Lindqvist 4d7bc4c169 VM: merge of slot_visitor and code_block_visitor
Looks like there is no reason for them to be separate classes and by
merging them you can simplify lots of code.
2015-01-15 09:29:14 +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 f0bf693beb VM: free_list_allocator::first_block, last_block and next_block_after can be refactored away 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 6244b925c7 vm: Simplify strerror code. 2014-07-05 18:58:24 -07:00
Doug Coleman 69262be4d8 vm: Add threadsafe_sterror to the vm. 2014-07-04 03:00:08 -07:00
Doug Coleman bc54927859 vm/image.cpp: Better error for opening a file for writing. 2014-07-03 22:32:45 -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 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 cae6a5e855 VM: Refactor image.cpp/hpp to Factor style 2013-05-12 13:24:44 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04:00
Joe Groff 9236c05e60 vm: stage code block map fixup properly for GC
Don't update the map until the very last thing, and pass untranslated addresses to the iterator functors. Somewhat complicated by the fact that, for startup_fixup, the map is initialized with fixed-up values, so the fixup functor needs a flag indicating whether it operates with a fixed or unfixed code heap map.
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 0b94018d9f vm: initialize all_blocks set after initial fixup 2011-12-14 09:56:46 -08:00
Joe Groff dea0bedb99 vm: fix msvc warning 2011-11-29 12:19:17 -08:00
Joe Groff 26226d460e vm: factor out embedded image detection code 2011-11-27 14:39:21 -08:00
Joe Groff cca526df73 vm: support self-executing image file 2011-11-27 12:37:54 -08:00
Joe Groff 81911b9f87 vm: initialize all_blocks map from image
um, code blocks from the image need to go in the set too
2011-11-23 11:11:26 -08: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 4405a66f99 vm: fix RT_HERE fixup on image load 2010-06-11 21:54:47 -04:00
Slava Pestov 806e54630a GC maps for more compact inline GC checks 2010-06-11 20:06:00 -04:00
Slava Pestov e5e51c40a1 vm: implement frame-based SEH for 64-bit Windows 2010-04-08 10:32:14 -07:00
Doug Coleman 06f02d1314 Refactor error handling in io.cpp. Update image.cpp and header files for changes. 2010-02-04 23:53:54 -06:00
Doug Coleman 950eaed73a Change the MOVE_FILE macro to a function named move_file 2010-02-03 15:12:13 -06:00
Doug Coleman 40cf302d2d Fix image save on Windows 2010-01-22 12:59:36 -06:00
Doug Coleman bb2f455747 Save images to a temporary file first, then call MOVE_FILE to avoid writing incomplete and truncated images. 2010-01-22 12:59:20 -06:00