X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fcompiler.lisp;h=e3bac1868841723fff0a9f74ffd42f5049a42c0e;hb=81003ba7f1fcb0d2e4232433665725f9286a958e;hp=c5c69bd5e63beb353d86867550c69fb292aa4b00;hpb=e1301bcded5eed2d9259d7688edf03892468fe2b;p=jscl.git diff --git a/src/compiler/compiler.lisp b/src/compiler/compiler.lisp index c5c69bd..e3bac18 100644 --- a/src/compiler/compiler.lisp +++ b/src/compiler/compiler.lisp @@ -773,8 +773,7 @@ (var (,idvar #())) ,cbody) (catch (cf) - (if (and (== (get cf "type") "block") - (== (get cf "id") ,idvar)) + (if (and (instanceof cf |BlockNLX|) (== (get cf "id") ,idvar)) ,(if *multiple-value-p* `(return (method-call |values| "apply" this (call |forcemv| (get cf "values")))) `(return (get cf "values"))) @@ -793,12 +792,10 @@ ;; capture it in a closure. `(selfcall ,(when multiple-value-p `(var (|values| |mv|))) - (throw - (object - "type" "block" - "id" ,(binding-value b) - "values" ,(convert value multiple-value-p) - "message" ,(concat "Return from unknown block '" (symbol-name name) "'.")))))) + (throw (new (call |BlockNLX| + ,(binding-value b) + ,(convert value multiple-value-p) + ,(symbol-name name))))))) (define-compilation catch (id &rest body) (let ((values (if *multiple-value-p* '|values| '|pv|))) @@ -863,26 +860,19 @@ default (break tbloop))) (catch (jump) - (if (and (== (get jump "type") "tagbody") - (== (get jump "id") ,tbidx)) + (if (and (instanceof jump |TagNLX|) (== (get jump "id") ,tbidx)) (= ,branch (get jump "label")) (throw jump))))) (return ,(convert nil)))))) (define-compilation go (label) - (let ((b (lookup-in-lexenv label *environment* 'gotag)) - (n (cond - ((symbolp label) (symbol-name label)) - ((integerp label) (integer-to-string label))))) + (let ((b (lookup-in-lexenv label *environment* 'gotag))) (when (null b) (error "Unknown tag `~S'" label)) `(selfcall - (throw - (object - "type" "tagbody" - "id" ,(first (binding-value b)) - "label" ,(second (binding-value b)) - "message" ,(concat "Attempt to GO to non-existing tag " n)))))) + (throw (new (call |TagNLX| + ,(first (binding-value b)) + ,(second (binding-value b)))))))) (define-compilation unwind-protect (form &rest clean-up) `(selfcall