Changeset 11819
- Timestamp:
- 05/03/09 08:46:39 (14 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp
r11818 r11819 313 313 ;; its cleanup forms. 314 314 (dformat t "*blocks* = ~S~%" (mapcar #'block-name *blocks*)) 315 (let ((protected 316 (dolist (enclosing-block *blocks*) 317 (when (eq enclosing-block block) 318 (return nil)) 319 (when (block-requires-non-local-exit-p enclosing-block) 320 (return t))))) 315 (let ((protected (enclosed-by-protected-block-p block))) 321 316 (dformat t "p1-return-from protected = ~S~%" protected) 322 317 (when protected … … 366 361 (cond ((eq (tag-compiland tag) *current-compiland*) 367 362 ;; Does the GO leave an enclosing UNWIND-PROTECT? 368 (let ((protected 369 (dolist (enclosing-block *blocks*) 370 (when (eq enclosing-block tag-block) 371 (return nil)) 372 (when (block-requires-non-local-exit-p enclosing-block) 373 (return t))))) 374 (when protected 375 (setf (block-non-local-go-p tag-block) t)))) 363 (when (enclosed-by-protected-block-p tag-block) 364 (setf (block-non-local-go-p tag-block) t))) 376 365 (t 377 366 (setf (block-non-local-go-p tag-block) t))))) -
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r11818 r11819 4439 4439 (compile-progn-body body target representation)))) 4440 4440 4441 (defknown find-tag (t) t)4442 (defun find-tag (name)4443 (dolist (tag *visible-tags*)4444 (when (eql name (tag-name tag))4445 (return tag))))4446 4447 4441 (defknown p2-tagbody-node (t t) t) 4448 4442 (defun p2-tagbody-node (block target) … … 4535 4529 ;; Local case. 4536 4530 (let* ((tag-block (tag-block tag)) 4537 (register nil) 4538 (protected 4539 ;; Does the GO leave an enclosing CATCH or UNWIND-PROTECT? 4540 (dolist (enclosing-block *blocks*) 4541 (when (eq enclosing-block tag-block) 4542 (return nil)) 4543 (when (block-requires-non-local-exit-p enclosing-block) 4544 (return t))))) 4545 (unless protected 4531 (register nil)) 4532 (unless (enclosed-by-protected-block-p tag-block) 4546 4533 (dolist (block *blocks*) 4547 4534 (if (eq block tag-block) … … 4723 4710 ;; Local case. Is the RETURN nested inside an UNWIND-PROTECT which is 4724 4711 ;; inside the block we're returning from? 4725 (let ((protected 4726 (dolist (enclosing-block *blocks*) 4727 (when (eq enclosing-block block) 4728 (return nil)) 4729 (when (block-requires-non-local-exit-p enclosing-block) 4730 (return t))))) 4731 (unless protected 4732 (unless (compiland-single-valued-p *current-compiland*) 4712 (unless (enclosed-by-protected-block-p block) 4713 (unless (compiland-single-valued-p *current-compiland*) 4733 4714 ;; (format t "compiland not single-valued: ~S~%" 4734 4715 ;; (compiland-name *current-compiland*)) 4735 4736 4737 4738 (return-from p2-return-from)))))4716 (emit-clear-values)) 4717 (compile-form result-form (block-target block) nil) 4718 (emit 'goto (block-exit block)) 4719 (return-from p2-return-from)))) 4739 4720 ;; Non-local RETURN. 4740 4721 (aver (block-non-local-return-p block)) -
trunk/abcl/src/org/armedbear/lisp/jvm.lisp
r11818 r11819 369 369 ) 370 370 371 (defvar *blocks* ()) 372 373 (defun find-block (name) 374 (dolist (block *blocks*) 375 (when (eq name (block-name block)) 376 (return block)))) 377 371 378 (defknown node-constant-p (t) boolean) 372 379 (defun node-constant-p (object) … … 390 397 (memq (block-name object) '(CATCH UNWIND-PROTECT))) 391 398 392 (defvar *blocks* ()) 393 394 (defun find-block (name) 395 (dolist (block *blocks*) 396 (when (eq name (block-name block)) 397 (return block)))) 399 400 (defknown enclosed-by-protected-block-p (&optional outermost-block) boolean) 401 (defun enclosed-by-protected-block-p (&optional outermost-block) 402 "Indicates whether the code being compiled/analyzed is enclosed in 403 a block which requires a non-local transfer of control exception to 404 be generated. 405 " 406 (dolist (enclosing-block *blocks*) 407 (when (eq enclosing-block outermost-block) 408 (return-from enclosed-by-protected-block-p nil)) 409 (when (block-requires-non-local-exit-p enclosing-block) 410 (return-from enclosed-by-protected-block-p t)))) 411 398 412 399 413 (defstruct tag … … 402 416 block 403 417 (compiland *current-compiland*)) 418 419 (defknown find-tag (t) t) 420 (defun find-tag (name) 421 (dolist (tag *visible-tags*) 422 (when (eql name (tag-name tag)) 423 (return tag)))) 404 424 405 425 (defun process-ignore/ignorable (declaration names variables)
Note: See TracChangeset
for help on using the changeset viewer.