gencgc: Reduce conservatism for pointers to unboxed pages.
[sbcl.git] / src / runtime / gencgc.c
index fbaaa9e..77ec797 100644 (file)
@@ -201,7 +201,18 @@ static inline boolean page_boxed_p(page_index_t page) {
 }
 
 static inline boolean code_page_p(page_index_t page) {
-    return (page_table[page].allocated & CODE_PAGE_FLAG);
+    /* This is used by the conservative pinning logic to determine if
+     * a page can contain code objects.  Ideally, we'd be able to
+     * check the page allocation flag to see if it is CODE_PAGE_FLAG,
+     * but this turns out not to be reliable (in fact, badly
+     * unreliable) at the moment.  On the upside, all code objects are
+     * boxed objects, so we can simply re-use the boxed_page_p() logic
+     * for a tighter result than merely "is this page allocated". */
+#if 0
+    return (page_table[page].allocated & CODE_PAGE_FLAG) == CODE_PAGE_FLAG;
+#else
+    return page_boxed_p(page);
+#endif
 }
 
 static inline boolean page_boxed_no_region_p(page_index_t page) {
@@ -4531,8 +4542,8 @@ prepare_for_final_gc ()
  * SB!VM:RESTART-LISP-FUNCTION */
 void
 gc_and_save(char *filename, boolean prepend_runtime,
-            boolean save_runtime_options,
-            boolean compressed, int compression_level)
+            boolean save_runtime_options, boolean compressed,
+            int compression_level, int application_type)
 {
     FILE *file;
     void *runtime_bytes = NULL;
@@ -4562,7 +4573,8 @@ gc_and_save(char *filename, boolean prepend_runtime,
     collect_garbage(HIGHEST_NORMAL_GENERATION+1);
 
     if (prepend_runtime)
-        save_runtime_to_filehandle(file, runtime_bytes, runtime_size);
+        save_runtime_to_filehandle(file, runtime_bytes, runtime_size,
+                                   application_type);
 
     /* The dumper doesn't know that pages need to be zeroed before use. */
     zero_all_free_pages();