Changeset 12066


Ignore:
Timestamp:
07/27/09 14:11:30 (14 years ago)
Author:
vvoutilainen
Message:

Revert r12065, it's not an obvious win and some systems
run slower when the fixed cache is used.

File:
1 edited

Legend:

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

    r12065 r12066  
    450450    private static class StackFrame
    451451    {
    452         public LispObject operator;
    453         private LispObject first;
    454         private LispObject second;
    455         private LispObject third;
    456         private LispObject[] args;
     452        public final LispObject operator;
     453        private final LispObject first;
     454        private final LispObject second;
     455        private final LispObject third;
     456        private final LispObject[] args;
    457457        final StackFrame next;
    458458
    459         public StackFrame(StackFrame next) {
    460             this.next = next;
    461         }
    462 
    463         public final void set(LispObject operator)
     459        public StackFrame(LispObject operator, StackFrame next)
    464460        {
    465461            this.operator = operator;
     
    468464            third = null;
    469465            args = null;
    470         }
    471 
    472         public final void set(LispObject operator, LispObject arg)
     466            this.next = next;
     467        }
     468
     469        public StackFrame(LispObject operator, LispObject arg, StackFrame next)
    473470        {
    474471            this.operator = operator;
     
    477474            third = null;
    478475            args = null;
    479         }
    480 
    481         public final void set(LispObject operator, LispObject first,
    482                               LispObject second)
     476            this.next = next;
     477        }
     478
     479        public StackFrame(LispObject operator, LispObject first,
     480                          LispObject second, StackFrame next)
    483481        {
    484482            this.operator = operator;
     
    487485            third = null;
    488486            args = null;
    489         }
    490 
    491         public final void set(LispObject operator, LispObject first,
    492                               LispObject second, LispObject third)
     487            this.next = next;
     488        }
     489
     490        public StackFrame(LispObject operator, LispObject first,
     491                          LispObject second, LispObject third, StackFrame next)
    493492        {
    494493            this.operator = operator;
     
    497496            this.third = third;
    498497            args = null;
    499         }
    500 
    501         public final void set(LispObject operator, LispObject[] args)
     498            this.next = next;
     499        }
     500
     501        public StackFrame(LispObject operator, LispObject[] args, StackFrame next)
    502502        {
    503503            this.operator = operator;
     
    506506            third = null;
    507507            this.args = args;
     508            this.next = next;
    508509        }
    509510
     
    541542
    542543    private StackFrame stack = null;
    543     private final int framePoolSize = 256;
    544     private final StackFrame[] framePool = new StackFrame[256];
    545     private int framePointer = -1;
    546544
    547545    @Deprecated
     
    565563    }
    566564
    567     private final StackFrame newStackFrame() {
    568         if (++framePointer < framePoolSize) {
    569             if (framePool[framePointer] == null)
    570                 framePool[framePointer] = new StackFrame(stack);
    571             return (stack = framePool[framePointer]);
    572         } else
    573             return (stack = new StackFrame(stack));
    574     }
    575 
    576565    public final void pushStackFrame(LispObject operator)
    577566        throws ConditionThrowable
    578567    {
    579         newStackFrame().set(operator);
     568        stack = new StackFrame(operator, stack);
    580569        doProfiling();
    581570    }
     
    584573        throws ConditionThrowable
    585574    {
    586         newStackFrame().set(operator, arg);
     575        stack = new StackFrame(operator, arg, stack);
    587576        doProfiling();
    588577    }
     
    592581        throws ConditionThrowable
    593582    {
    594         newStackFrame().set(operator, first, second);
     583        stack = new StackFrame(operator, first, second, stack);
    595584        doProfiling();
    596585    }
     
    600589        throws ConditionThrowable
    601590    {
    602         newStackFrame().set(operator, first, second, third);
     591        stack = new StackFrame(operator, first, second, third, stack);
    603592        doProfiling();
    604593    }
     
    607596        throws ConditionThrowable
    608597    {
    609         newStackFrame().set(operator, args);
     598        stack = new StackFrame(operator, args, stack);
    610599        doProfiling();
    611600    }
     
    613602    public final void popStackFrame()
    614603    {
    615         if (stack != null) {
    616             if (framePointer < framePoolSize)
    617                 stack.set(null);
     604        if (stack != null)
    618605            stack = stack.next;
    619             framePointer--;
    620         }
    621606    }
    622607
     
    624609    {
    625610        stack = null;
    626         // Clear out old frames, in order to prevent leaking references
    627         // to old objects
    628         for (StackFrame frame : framePool)
    629             if (frame != null)
    630                 frame.set(null);
    631         framePointer = -1;
    632611    }
    633612
Note: See TracChangeset for help on using the changeset viewer.