Changeset 11814


Ignore:
Timestamp:
05/02/09 20:14:16 (13 years ago)
Author:
ehuelsmann
Message:

Resolve part 1 of ticket #21: Don't use JSR and RET JVM instructions.

Note: This solution inlines the cleanup twice. Since our own build

only increases by a few bytes, we'll go with this solution until
there's a real issue for someone.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11798 r11814  
    78657865           (result-register (allocate-register))
    78667866           (values-register (allocate-register))
    7867            (return-address-register (allocate-register))
    78687867           (BEGIN-PROTECTED-RANGE (gensym))
    78697868           (END-PROTECTED-RANGE (gensym))
    78707869           (HANDLER (gensym))
    7871            (EXIT (gensym))
    7872            (CLEANUP (gensym)))
     7870           (EXIT (gensym)))
    78737871      ;; Make sure there are no leftover multiple return values from previous calls.
    78747872      (emit-clear-values)
     
    78817879        (astore values-register)
    78827880        (label END-PROTECTED-RANGE))
    7883       (emit 'jsr CLEANUP)
     7881      (dolist (subform cleanup-forms)
     7882        (compile-form subform nil nil))
    78847883      (emit 'goto EXIT) ; Jump over handler.
    78857884      (label HANDLER) ; Start of exception handler.
    78867885      ;; The Throwable object is on the runtime stack. Stack depth is 1.
    78877886      (astore exception-register)
    7888       (emit 'jsr CLEANUP) ; Call cleanup forms.
     7887      (dolist (subform cleanup-forms)
     7888        (compile-form subform nil nil))
    78897889      (emit-clear-values)
    78907890      (aload exception-register)
    78917891      (emit 'athrow) ; Re-throw exception.
    7892       (label CLEANUP) ; Cleanup forms.
    7893       ;; Return address is on stack here.
    7894       (astore return-address-register)
    7895       (dolist (subform cleanup-forms)
    7896         (compile-form subform nil nil))
    7897       (emit 'ret return-address-register)
    78987892      (label EXIT)
    78997893      ;; Restore multiple values returned by protected form.
Note: See TracChangeset for help on using the changeset viewer.