Changeset 12272


Ignore:
Timestamp:
11/08/09 22:37:19 (11 years ago)
Author:
ehuelsmann
Message:

Implement functional (declared final) interface to special bindings state unwinding
in preparation of an experiment to make our special binding access work like SBCL/CCL
with an array of "currently valid" special values.

Note: FASL version increase is not required: the old way still works.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
1 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/AbstractArray.java

    r12254 r12272  
    259259            int currentLevel = Fixnum.getValue(currentPrintLevel);
    260260            if (currentLevel < maxLevel) {
    261                 SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     261                final SpecialBindingsMark mark = thread.markSpecialBindings();
    262262                thread.bindSpecial(_CURRENT_PRINT_LEVEL_, currentPrintLevel.incr());
    263263                try {
     
    282282                }
    283283                finally {
    284                     thread.lastSpecialBinding = lastSpecialBinding;
     284                    thread.resetSpecialBindings(mark);
    285285                }
    286286            } else
  • trunk/abcl/src/org/armedbear/lisp/AbstractVector.java

    r12254 r12272  
    245245            final int length = length();
    246246            final int limit = Math.min(length, maxLength);
    247             SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     247            final SpecialBindingsMark mark = thread.markSpecialBindings();
    248248            thread.bindSpecial(_CURRENT_PRINT_LEVEL_, currentPrintLevel.incr());
    249249            try
     
    258258            finally
    259259              {
    260                 thread.lastSpecialBinding = lastSpecialBinding;
     260                thread.resetSpecialBindings(mark);
    261261              }
    262262            if (limit < length)
  • trunk/abcl/src/org/armedbear/lisp/Autoload.java

    r12255 r12272  
    9898        if (className != null) {
    9999            final LispThread thread = LispThread.currentThread();
    100             final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     100            final SpecialBindingsMark mark = thread.markSpecialBindings();
    101101            int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue());
    102102            thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
     
    129129            }
    130130            finally {
    131                 thread.lastSpecialBinding = lastSpecialBinding;
     131                thread.resetSpecialBindings(mark);
    132132            }
    133133        } else
  • trunk/abcl/src/org/armedbear/lisp/Closure.java

    r12254 r12272  
    388388  {
    389389    final LispThread thread = LispThread.currentThread();
    390     final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     390    final SpecialBindingsMark mark = thread.markSpecialBindings();
    391391    Environment ext = new Environment(environment);
    392392    bindRequiredParameters(ext, thread, objects);
     
    406406    finally
    407407      {
    408         thread.lastSpecialBinding = lastSpecialBinding;
     408        thread.resetSpecialBindings(mark);
    409409      }
    410410  }
     
    582582  {
    583583    final LispThread thread = LispThread.currentThread();
    584     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     584    final SpecialBindingsMark mark = thread.markSpecialBindings();
    585585    Environment ext = new Environment(environment);
    586586    if (optionalParameters.length == 0 && keywordParameters.length == 0)
     
    606606    finally
    607607      {
    608         thread.lastSpecialBinding = lastSpecialBinding;
     608        thread.resetSpecialBindings(mark);
    609609      }
    610610  }
     
    631631    // returns. They are used only in the evaluation of initforms for
    632632    // optional and keyword arguments.
    633     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     633    final SpecialBindingsMark mark = thread.markSpecialBindings();
    634634    Environment ext = new Environment(environment);
    635635    // Section 3.4.4: "...the &environment parameter is bound along with
     
    865865    }
    866866    finally {
    867         thread.lastSpecialBinding = lastSpecialBinding;
     867        thread.resetSpecialBindings(mark);
    868868    }
    869869    return array;
  • trunk/abcl/src/org/armedbear/lisp/Cons.java

    r12254 r12272  
    655655    if (currentLevel < maxLevel)
    656656      {
    657         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     657        final SpecialBindingsMark mark = thread.markSpecialBindings();
    658658        thread.bindSpecial(_CURRENT_PRINT_LEVEL_, currentPrintLevel.incr());
    659659        try
     
    695695        finally
    696696          {
    697             thread.lastSpecialBinding = lastSpecialBinding;
     697            thread.resetSpecialBindings(mark);
    698698          }
    699699      }
  • trunk/abcl/src/org/armedbear/lisp/Do.java

    r12254 r12272  
    9494      }
    9595    final LispThread thread = LispThread.currentThread();
    96     final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     96    final SpecialBindingsMark mark = thread.markSpecialBindings();
    9797    // Process declarations.
    9898
     
    198198    finally
    199199      {
    200         thread.lastSpecialBinding = lastSpecialBinding;
     200        thread.resetSpecialBindings(mark);
    201201        ext.inactive = true;
    202202      }
  • trunk/abcl/src/org/armedbear/lisp/Function.java

    r12255 r12272  
    274274            } else {
    275275                final LispThread thread = LispThread.currentThread();
    276                 SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     276                final SpecialBindingsMark mark = thread.markSpecialBindings();
    277277                thread.bindSpecial(Symbol.PRINT_LENGTH, Fixnum.THREE);
    278278                try {
     
    280280                }
    281281                finally {
    282                     thread.lastSpecialBinding = lastSpecialBinding;
     282                    thread.resetSpecialBindings(mark);
    283283                }
    284284            }
  • trunk/abcl/src/org/armedbear/lisp/Interpreter.java

    r12255 r12272  
    326326                try {
    327327                    thread.resetStack();
    328                     thread.lastSpecialBinding = null;
     328                    thread.clearSpecialBindings();
    329329                    out._writeString("* ");
    330330                    out._finishOutput();
     
    476476            if (interpreter == null) {
    477477                final LispThread thread = LispThread.currentThread();
    478                 final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     478                final SpecialBindingsMark mark = thread.markSpecialBindings();
    479479                thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    480480                try {
     
    501501                catch (Throwable t) {}
    502502                finally {
    503                     thread.lastSpecialBinding = lastSpecialBinding;
     503                    thread.resetSpecialBindings(mark);
    504504                }
    505505            }
     
    536536        if (obj == EOF)
    537537            return error(new EndOfFile(stream));
    538         final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     538        final SpecialBindingsMark mark = thread.markSpecialBindings();
    539539        thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
    540540        try {
     
    542542        }
    543543        finally {
    544             thread.lastSpecialBinding = lastSpecialBinding;
     544            thread.resetSpecialBindings(mark);
    545545        }
    546546    }
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r12255 r12272  
    20292029                      {
    20302030                        LispObject obj = args[j++];
    2031                         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     2031                        final SpecialBindingsMark mark = thread.markSpecialBindings();
    20322032                        thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    20332033                        thread.bindSpecial(Symbol.PRINT_READABLY, NIL);
    2034                         sb.append(obj.writeToString());
    2035                         thread.lastSpecialBinding = lastSpecialBinding;
     2034                        try {
     2035                            sb.append(obj.writeToString());
     2036                        }
     2037                        finally {
     2038                            thread.resetSpecialBindings(mark);
     2039                        }
    20362040                      }
    20372041                  }
     
    20412045                      {
    20422046                        LispObject obj = args[j++];
    2043                         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     2047                        final SpecialBindingsMark mark = thread.markSpecialBindings();
    20442048                        thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    20452049                        try {
     
    20472051                        }
    20482052                        finally {
    2049                             thread.lastSpecialBinding = lastSpecialBinding;
     2053                            thread.resetSpecialBindings(mark);
    20502054                        }
    20512055                      }
     
    20562060                      {
    20572061                        LispObject obj = args[j++];
    2058                         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     2062                        final SpecialBindingsMark mark = thread.markSpecialBindings();
    20592063                        thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    20602064                        thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
     
    20642068                        }
    20652069                        finally {
    2066                             thread.lastSpecialBinding = lastSpecialBinding;
     2070                            thread.resetSpecialBindings(mark);
    20672071                        }
    20682072                      }
     
    20732077                      {
    20742078                        LispObject obj = args[j++];
    2075                         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     2079                        final SpecialBindingsMark mark = thread.markSpecialBindings();
    20762080                        thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    20772081                        thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
     
    20812085                        }
    20822086                        finally {
    2083                             thread.lastSpecialBinding = lastSpecialBinding;
     2087                            thread.resetSpecialBindings(mark);
    20842088                        }
    20852089                      }
  • trunk/abcl/src/org/armedbear/lisp/LispThread.java

    r12255 r12272  
    307307    }
    308308
     309    /** Marks the state of the special bindings,
     310     * for later rewinding by resetSpecialBindings().
     311     */
     312    public final SpecialBindingsMark markSpecialBindings() {
     313        return new SpecialBindingsMark(lastSpecialBinding);
     314    }
     315
     316    /** Restores the state of the special bindings to what
     317     * was captured in the marker 'mark' by a call to markSpecialBindings().
     318     */
     319    public final void resetSpecialBindings(SpecialBindingsMark mark) {
     320        lastSpecialBinding = mark.binding;
     321    }
     322
     323    /** Clears out all active special bindings including any marks
     324     * previously set. Invoking resetSpecialBindings() with marks
     325     * set before this call results in undefined behaviour.
     326     */
     327    // Package level access: only for Interpreter.run()
     328    final void clearSpecialBindings() {
     329        lastSpecialBinding = null;
     330    }
     331
    309332    public final SpecialBinding bindSpecial(Symbol name, LispObject value)
    310333    {
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r12254 r12272  
    283283        LispThread thread = LispThread.currentThread();
    284284        if (auto) {
    285             SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     285            final SpecialBindingsMark mark = thread.markSpecialBindings();
    286286            thread.bindSpecial(Symbol.CURRENT_READTABLE,
    287287                               STANDARD_READTABLE.symbolValue(thread));
     
    294294            }
    295295            finally {
    296                 thread.lastSpecialBinding = lastSpecialBinding;
     296                thread.resetSpecialBindings(mark);
    297297            }
    298298        } else {
     
    387387                if (in != null) {
    388388                    final LispThread thread = LispThread.currentThread();
    389                     final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     389                    final SpecialBindingsMark mark = thread.markSpecialBindings();
    390390                    thread.bindSpecial(_WARN_ON_REDEFINITION_, NIL);
    391391                    try {
     
    401401                    }
    402402                    finally {
    403                         thread.lastSpecialBinding = lastSpecialBinding;
     403                        thread.resetSpecialBindings(mark);
    404404                        try {
    405405                            in.close();
     
    482482        long start = System.currentTimeMillis();
    483483        final LispThread thread = LispThread.currentThread();
    484         final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     484        final SpecialBindingsMark mark = thread.markSpecialBindings();
    485485        // "LOAD binds *READTABLE* and *PACKAGE* to the values they held before
    486486        // loading the file."
     
    528528        }
    529529        finally {
    530             thread.lastSpecialBinding = lastSpecialBinding;
     530            thread.resetSpecialBindings(mark);
    531531        }
    532532    }
     
    550550
    551551    {
    552         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     552        final SpecialBindingsMark mark = thread.markSpecialBindings();
    553553        thread.bindSpecial(_LOAD_STREAM_, in);
    554554        SpecialBinding sourcePositionBinding =
    555             new SpecialBinding(_SOURCE_POSITION_, Fixnum.ZERO,
    556                                thread.lastSpecialBinding);
    557         thread.lastSpecialBinding = sourcePositionBinding;
     555            thread.bindSpecial(_SOURCE_POSITION_, Fixnum.ZERO);
    558556        try {
    559557            final Environment env = new Environment();
     
    579577        }
    580578        finally {
    581             thread.lastSpecialBinding = lastSpecialBinding;
     579            thread.resetSpecialBindings(mark);
    582580        }
    583581    }
     
    588586        Stream in = (Stream) _LOAD_STREAM_.symbolValue(thread);
    589587        final Environment env = new Environment();
    590         final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     588        final SpecialBindingsMark mark = thread.markSpecialBindings();
    591589        LispObject result = NIL;
    592590        try {
     
    600598        }
    601599        finally {
    602             thread.lastSpecialBinding = lastSpecialBinding;
     600            thread.resetSpecialBindings(mark);
    603601        }
    604602        return result;
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r12254 r12272  
    16431643                else
    16441644                  {
    1645                     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     1645                    SpecialBindingsMark mark = thread.markSpecialBindings();
    16461646                    thread.bindSpecial(Symbol._PACKAGE_, PACKAGE_CL);
    16471647                    try
     
    16521652                    finally
    16531653                      {
    1654                         thread.lastSpecialBinding = lastSpecialBinding;
     1654                        thread.resetSpecialBindings(mark);
    16551655                      }
    16561656                  }
     
    34593459        LispObject defs = checkList(args.car());
    34603460        final LispThread thread = LispThread.currentThread();
    3461         final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     3461        final SpecialBindingsMark mark = thread.markSpecialBindings();
    34623462
    34633463        try
     
    34823482        finally
    34833483          {
    3484             thread.lastSpecialBinding = lastSpecialBinding;
     3484            thread.resetSpecialBindings(mark);
    34853485          }
    34863486      }
     
    37493749        body = bodyAndDecls.car();
    37503750
    3751         final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     3751        final SpecialBindingsMark mark = thread.markSpecialBindings();
    37523752        final Environment ext = new Environment(env);
    37533753        int i = 0;
     
    37933793        finally
    37943794          {
    3795             thread.lastSpecialBinding = lastSpecialBinding;
     3795            thread.resetSpecialBindings(mark);
    37963796          }
    37973797        return result;
  • trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java

    r12254 r12272  
    9090        if (object != UNBOUND_VALUE) {
    9191            final LispThread thread = LispThread.currentThread();
    92             final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     92            final SpecialBindingsMark mark = thread.markSpecialBindings();
    9393            thread.bindSpecial(Symbol.PRINT_READABLY, NIL);
    9494            thread.bindSpecial(Symbol.PRINT_ARRAY, NIL);
     
    100100            }
    101101            finally {
    102                 thread.lastSpecialBinding = lastSpecialBinding;
     102                thread.resetSpecialBindings(mark);
    103103            }
    104104        } else
  • trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java

    r12254 r12272  
    115115  {
    116116    final LispThread thread = LispThread.currentThread();
    117     final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     117    final SpecialBindingsMark mark = thread.markSpecialBindings();
    118118    try
    119119      {
     
    167167    finally
    168168      {
    169         thread.lastSpecialBinding = lastSpecialBinding;
     169        thread.resetSpecialBindings(mark);
    170170      }
    171171  }
     
    181181        LispObject varList = checkList(args.car());
    182182        final LispThread thread = LispThread.currentThread();
    183         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     183        final SpecialBindingsMark mark = thread.markSpecialBindings();
    184184        Environment ext = new Environment(env);
    185185        try
     
    216216        finally
    217217            {
    218                 thread.lastSpecialBinding = lastSpecialBinding;
     218              thread.resetSpecialBindings(mark);
    219219            }
    220220      }
     
    301301    LispObject defs = checkList(args.car());
    302302    final LispThread thread = LispThread.currentThread();
    303     final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     303    final SpecialBindingsMark mark = thread.markSpecialBindings();
    304304    final Environment funEnv = new Environment(env);
    305305    while (defs != NIL)
     
    358358    finally
    359359      {
    360         thread.lastSpecialBinding = lastSpecialBinding;
     360        thread.resetSpecialBindings(mark);
    361361      }
    362362  }
     
    410410        final LispObject symbols = checkList(eval(args.car(), env, thread));
    411411        LispObject values = checkList(eval(args.cadr(), env, thread));
    412         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     412        final SpecialBindingsMark mark = thread.markSpecialBindings();
    413413        try
    414414          {
     
    420420        finally
    421421          {
    422             thread.lastSpecialBinding = lastSpecialBinding;
     422            thread.resetSpecialBindings(mark);
    423423          }
    424424      }
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r12255 r12272  
    469469    else
    470470      {
    471         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     471        final SpecialBindingsMark mark = thread.markSpecialBindings();
    472472        thread.bindSpecial(_SHARP_EQUAL_ALIST_, NIL);
    473473        try
     
    477477        finally
    478478          {
    479             thread.lastSpecialBinding = lastSpecialBinding;
     479            thread.resetSpecialBindings(mark);
    480480          }
    481481      }
     
    544544    else
    545545      {
    546         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     546        final SpecialBindingsMark mark = thread.markSpecialBindings();
    547547        thread.bindSpecial(_SHARP_EQUAL_ALIST_, NIL);
    548548        try
     
    552552        finally
    553553          {
    554             thread.lastSpecialBinding = lastSpecialBinding;
     554            thread.resetSpecialBindings(mark);
    555555          }
    556556      }
     
    18421842  {
    18431843    LispThread thread = LispThread.currentThread();
    1844     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     1844    final SpecialBindingsMark mark = thread.markSpecialBindings();
    18451845    thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    18461846    try
     
    18501850    finally
    18511851      {
    1852         thread.lastSpecialBinding = lastSpecialBinding;
     1852        thread.resetSpecialBindings(mark);
    18531853      }
    18541854  }
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r12255 r12272  
    108108  {
    109109    final LispThread thread = LispThread.currentThread();
    110     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     110    final SpecialBindingsMark mark = thread.markSpecialBindings();
    111111    thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    112112    try
     
    129129    finally
    130130      {
    131         thread.lastSpecialBinding = lastSpecialBinding;
     131        thread.resetSpecialBindings(mark);
    132132      }
    133133  }
  • trunk/abcl/src/org/armedbear/lisp/TypeError.java

    r12254 r12272  
    131131        try {
    132132            final LispThread thread = LispThread.currentThread();
    133             final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     133            final SpecialBindingsMark mark = thread.markSpecialBindings();
    134134            thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    135135            try {
     
    165165            }
    166166            finally {
    167                 thread.lastSpecialBinding = lastSpecialBinding;
     167                thread.resetSpecialBindings(mark);
    168168            }
    169169        }
  • trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java

    r12254 r12272  
    7171    {
    7272        final LispThread thread = LispThread.currentThread();
    73         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     73        final SpecialBindingsMark mark = thread.markSpecialBindings();
    7474        thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    7575        try {
     
    8282        }
    8383        finally {
    84             thread.lastSpecialBinding = lastSpecialBinding;
     84            thread.resetSpecialBindings(mark);
    8585        }
    8686    }
  • trunk/abcl/src/org/armedbear/lisp/UnboundVariable.java

    r12254 r12272  
    5050  {
    5151    LispThread thread = LispThread.currentThread();
    52     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     52    final SpecialBindingsMark mark = thread.markSpecialBindings();
    5353    thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    5454    StringBuffer sb = new StringBuffer("The variable ");
     
    6060    catch (Throwable t) {}
    6161    finally {
    62         thread.lastSpecialBinding = lastSpecialBinding;
     62        thread.resetSpecialBindings(mark);
    6363    }
    6464    sb.append(" is unbound.");
  • trunk/abcl/src/org/armedbear/lisp/arglist.java

    r12254 r12272  
    8282                // Bind *PACKAGE* so we use the EXT package if we need
    8383                // to intern any symbols.
    84                 SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     84                final SpecialBindingsMark mark = thread.markSpecialBindings();
    8585                thread.bindSpecial(Symbol._PACKAGE_, PACKAGE_EXT);
    8686                try {
     
    8888                }
    8989                finally {
    90                     thread.lastSpecialBinding = lastSpecialBinding;
     90                    thread.resetSpecialBindings(mark);
    9191                }
    9292                operator.setLambdaList(arglist);
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12234 r12272  
    240240(defconstant +lisp-special-binding+ "Lorg/armedbear/lisp/SpecialBinding;")
    241241(defconstant +lisp-special-binding-class+ "org/armedbear/lisp/SpecialBinding")
     242(defconstant +lisp-special-bindings-mark+ "Lorg/armedbear/lisp/SpecialBindingsMark;")
     243(defconstant +lisp-special-bindings-mark-class+ "org/armedbear/lisp/SpecialBindingsMark")
    242244(defconstant +lisp-throw-class+ "org/armedbear/lisp/Throw")
    243245(defconstant +lisp-return-class+ "org/armedbear/lisp/Return")
     
    40474049
    40484050(defun restore-dynamic-environment (register)
    4049   (emit-push-current-thread)
    4050   (aload register)
    4051   (emit 'putfield +lisp-thread-class+ "lastSpecialBinding"
    4052   +lisp-special-binding+))
     4051   (emit-push-current-thread)
     4052   (aload register)
     4053;;   (emit 'putfield +lisp-thread-class+ "lastSpecialBinding"
     4054;;  +lisp-special-binding+)
     4055   (emit-invokevirtual +lisp-thread-class+ "resetSpecialBindings"
     4056                       (list +lisp-special-bindings-mark+) nil)
     4057  )
    40534058
    40544059(defun save-dynamic-environment (register)
    4055   (emit-push-current-thread)
    4056   (emit 'getfield +lisp-thread-class+ "lastSpecialBinding"
    4057   +lisp-special-binding+)
    4058   (astore register))
     4060   (emit-push-current-thread)
     4061;;   (emit 'getfield +lisp-thread-class+ "lastSpecialBinding"
     4062;;  +lisp-special-binding+)
     4063   (emit-invokevirtual +lisp-thread-class+ "markSpecialBindings"
     4064                       nil +lisp-special-bindings-mark+)
     4065   (astore register)
     4066  )
    40594067
    40604068(defun restore-environment-and-make-handler (register label-START)
  • trunk/abcl/src/org/armedbear/lisp/dolist.java

    r12254 r12272  
    5252    final LispThread thread = LispThread.currentThread();
    5353    LispObject resultForm = args.cdr().cdr().car();
    54     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     54    final SpecialBindingsMark mark = thread.markSpecialBindings();
    5555    // Process declarations.
    5656    LispObject bodyAndDecls = parseBody(bodyForm, false);
     
    122122    finally
    123123      {
    124         thread.lastSpecialBinding = lastSpecialBinding;
     124        thread.resetSpecialBindings(mark);
    125125        ext.inactive = true;
    126126      }
  • trunk/abcl/src/org/armedbear/lisp/dotimes.java

    r12254 r12272  
    5151    final LispThread thread = LispThread.currentThread();
    5252    LispObject resultForm = args.cdr().cdr().car();
    53     SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     53    final SpecialBindingsMark mark = thread.markSpecialBindings();
    5454
    5555    LispObject bodyAndDecls = parseBody(bodyForm, false);
     
    148148    finally
    149149      {
    150         thread.lastSpecialBinding = lastSpecialBinding;
     150        thread.resetSpecialBindings(mark);
    151151        ext.inactive = true;
    152152      }
Note: See TracChangeset for help on using the changeset viewer.