Utility predicates for packing: UNBOUNDED-SC-P and UNBOUNDED-TN-P
[sbcl.git] / src / compiler / policies.lisp
index 1ee4f10..7e3aaaf 100644 (file)
 
 (in-package "SB!C")
 
+(define-optimization-quality check-constant-modification
+    safety
+  ("no" "maybe" "yes" "yes")
+  "Control whether the compiler should check for constant
+modification. Defaults to SAFETY.")
+
 (define-optimization-quality type-check
     ;; FIXME: grepping the tree for "policy.*safety" yields some
     ;; places which might want to use this instead -- or
@@ -39,32 +45,25 @@ Enabling this option can increase heap consing of closures.")
   ("off" "maybe" "on" "on")
   "Control inline-substitution of used-once local functions.")
 
+(define-optimization-quality alien-funcall-saves-fp-and-pc
+    (if (<= speed debug) 3 0)
+  ("no" "maybe" "yes" "yes")
+  "Control ALIEN-FUNCALL saving frame-pointer and program counter for
+more reliable bactracing across foreign calls.")
+
 (define-optimization-quality verify-arg-count
     (if (zerop safety) 0 3)
   ("no" "maybe" "yes" "yes"))
 
-(define-optimization-quality merge-tail-calls
-    (if (or (> space debug)
-            (> speed debug))
-        3
-        0)
-  ("no" "maybe" "yes" "yes")
-  "Control whether tail-calls should reuse caller stack frame.
-Enabling this option make functions use less stack space, and make
-tail-recursive functions execute in constant stack, but debugging
-become harder, because backtraces show only part of function call
-sequence.
-
-This options has no effect when INSERT-DEBUG-CATCH is set.")
-
 (define-optimization-quality insert-debug-catch
     (if (> debug (max speed space))
         3
         0)
   ("no" "maybe" "yes" "yes")
-  "Enable possibility of returning from stack frames with the debugger.
-
-Enabling this option effectively disables MERGE-TAIL-CALLS.")
+  "Enables possibility of returning from stack frames with the debugger.
+Enabling this option causes apparent tail calls to no longer be in a tail
+position -- effectively disabling tail-merging, hence causing apparently tail
+recursive functions to no longer execute in constant stack space")
 
 (define-optimization-quality recognize-self-calls
     (if (> (max speed space) debug)
@@ -85,28 +84,6 @@ run-time, which is less efficient. TRACE will show recursive calls. In
 case of renaming described above, calls to FOO will not be recursive
 and will refer to the new function, bound to FOO.")
 
-(define-optimization-quality stack-allocate-dynamic-extent
-    (if (and (> (max speed space) (max debug safety))
-             (< safety 3))
-        3
-        0)
-  ("no" "maybe" "yes" "yes")
-  "Control whether allocate objects, declared DYNAMIC-EXTENT, on
-stack.")
-
-(define-optimization-quality stack-allocate-vector
-    (cond ((= stack-allocate-dynamic-extent 0) 0)
-          ((= safety 0) 3)
-          (t 2))
-  ("no" "maybe" "one page" "yes")
-  "Control what vectors, declared DYNAMIC-EXTENT, are allocated on stack:
-0: no vectors are allocated on stack;
-2: only short vectors (compiler knows them to fit on one page);
-3: every.
-
-This option has an effect only when STACK-ALLOCATE-DYNAMIC-EXTENT is
-set.")
-
 (define-optimization-quality float-accuracy
     3
   ("degraded" "full" "full" "full"))
@@ -152,3 +129,16 @@ debugger.")
 (define-optimization-quality store-coverage-data
     0
   ("no" "no" "yes" "yes"))
+
+#!+sb-safepoint
+(define-optimization-quality inhibit-safepoints
+    0
+  ("no" "no" "yes" "yes")
+  "When disabled, the compiler will insert safepoints at strategic
+points (loop edges, function prologues) to ensure that potentially
+long-running code can be interrupted.
+
+When enabled, no safepoints will be inserted explicitly.  Note that
+this declaration does not prevent out-of-line function calls, which
+will encounter safepoints unless the target function has also been
+compiled with this declaration in effect.")