remove world-lock from WITH-COMPILATION-UNIT
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 25 Sep 2012 10:30:59 +0000 (13:30 +0300)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 3 Oct 2012 05:18:52 +0000 (08:18 +0300)
   Add it to SUB-COMPILE-FILE and ACTUALLY-COMPILE instead.

src/compiler/main.lisp
src/compiler/target-main.lisp

index c7f19ce..f063f3b 100644 (file)
@@ -236,17 +236,16 @@ Examples:
                        (*compiler-note-count* 0)
                        (*undefined-warnings* nil)
                        (*in-compilation-unit* t))
-                   (with-world-lock ()
-                     (handler-bind ((parse-unknown-type
-                                     (lambda (c)
-                                       (note-undefined-reference
-                                        (parse-unknown-type-specifier c)
-                                        :type))))
-                       (unwind-protect
-                            (multiple-value-prog1 (funcall fn) (setf succeeded-p t))
-                         (unless succeeded-p
-                           (incf *aborted-compilation-unit-count*))
-                         (summarize-compilation-unit (not succeeded-p))))))))))
+                   (handler-bind ((parse-unknown-type
+                                    (lambda (c)
+                                      (note-undefined-reference
+                                       (parse-unknown-type-specifier c)
+                                       :type))))
+                     (unwind-protect
+                          (multiple-value-prog1 (funcall fn) (setf succeeded-p t))
+                       (unless succeeded-p
+                         (incf *aborted-compilation-unit-count*))
+                       (summarize-compilation-unit (not succeeded-p)))))))))
     (if policy
         (let ((*policy* (process-optimize-decl policy (unless override *policy*)))
               (*policy-restrictions* (unless override *policy-restrictions*)))
@@ -1674,31 +1673,29 @@ Examples:
     (handler-case
         (handler-bind (((satisfies handle-condition-p) #'handle-condition-handler))
           (with-compilation-values
-              (sb!xc:with-compilation-unit ()
+            (sb!xc:with-compilation-unit ()
+              (with-world-lock ()
                 (clear-stuff)
-
                 (sub-sub-compile-file info)
-
                 (unless (zerop (hash-table-count *code-coverage-records*))
                   ;; Dump the code coverage records into the fasl.
                   (fopcompile `(record-code-coverage
                                 ',(namestring *compile-file-pathname*)
                                 ',(let (list)
-                                       (maphash (lambda (k v)
-                                                  (declare (ignore k))
-                                                  (push v list))
-                                                *code-coverage-records*)
-                                       list))
+                                    (maphash (lambda (k v)
+                                               (declare (ignore k))
+                                               (push v list))
+                                             *code-coverage-records*)
+                                    list))
                               nil
                               nil))
-
                 (finish-block-compilation)
                 (let ((object *compile-object*))
                   (etypecase object
                     (fasl-output (fasl-dump-source-info info object))
                     (core-object (fix-core-source-info info object))
                     (null)))
-                nil)))
+                nil))))
       ;; Some errors are sufficiently bewildering that we just fail
       ;; immediately, without trying to recover and compile more of
       ;; the input file.
index 46ec5eb..4307d78 100644 (file)
                (*compile-verbose* nil)
                (*compile-print* nil)
                (oops nil))
-          (handler-bind (((satisfies handle-condition-p) #'handle-condition-handler))
-            (clear-stuff)
-            (unless source-paths
-              (find-source-paths form tlf))
-            (let ((*compiler-error-bailout*
-                    (lambda (e)
-                      (setf oops e)
-                      ;; Unwind the compiler frames: users want the know where
-                      ;; the error came from, not how the compiler got there.
-                      (go :error))))
-              (return (%compile form (make-core-object)
-                                :name name
-                                :path `(original-source-start 0 ,tlf)))))
+          (with-world-lock ()
+            (handler-bind (((satisfies handle-condition-p) #'handle-condition-handler))
+              (clear-stuff)
+              (unless source-paths
+                (find-source-paths form tlf))
+              (let ((*compiler-error-bailout*
+                      (lambda (e)
+                        (setf oops e)
+                        ;; Unwind the compiler frames: users want the know where
+                        ;; the error came from, not how the compiler got there.
+                        (go :error))))
+                (return (%compile form (make-core-object)
+                                  :name name
+                                  :path `(original-source-start 0 ,tlf))))))
         :error
           ;; Either signal the error right away, or return a function that
           ;; will signal the corresponding COMPILED-PROGRAM-ERROR. This is so