From: Nikodemus Siivola Date: Tue, 25 Sep 2012 10:30:59 +0000 (+0300) Subject: remove world-lock from WITH-COMPILATION-UNIT X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1fd7c4a202a8d22c681110e49c0d396b89afc428;p=sbcl.git remove world-lock from WITH-COMPILATION-UNIT Add it to SUB-COMPILE-FILE and ACTUALLY-COMPILE instead. --- diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index c7f19ce..f063f3b 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -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. diff --git a/src/compiler/target-main.lisp b/src/compiler/target-main.lisp index 46ec5eb..4307d78 100644 --- a/src/compiler/target-main.lisp +++ b/src/compiler/target-main.lisp @@ -93,19 +93,20 @@ (*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