From: <cg...@us...> - 2008-10-26 06:23:25
|
Revision: 5509 http://jython.svn.sourceforge.net/jython/?rev=5509&view=rev Author: cgroves Date: 2008-10-26 06:23:15 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Stuff commented out "for now" 10 years ago referring to code that no longer exists is probably with us for good. Modified Paths: -------------- trunk/jython/src/org/python/core/ThreadState.java Modified: trunk/jython/src/org/python/core/ThreadState.java =================================================================== --- trunk/jython/src/org/python/core/ThreadState.java 2008-10-25 23:03:38 UTC (rev 5508) +++ trunk/jython/src/org/python/core/ThreadState.java 2008-10-26 06:23:15 UTC (rev 5509) @@ -1,70 +1,58 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.core; -import java.util.Stack; +import java.util.LinkedList; public class ThreadState { - // public InterpreterState interp; + public PySystemState systemState; public PyFrame frame; - // public PyObject curexc_type, curexc_value, curexc_traceback; - // public PyObject exc_type, exc_value, exc_traceback; public PyException exception; public Thread thread; public boolean tracing; - public PyList reprStack = null; + public PyList reprStack; - // public PyInstance initializingProxy = null; - private Stack initializingProxies = null; + public int compareStateNesting; - public int compareStateNesting = 0; + public int recursion_depth; - private PyDictionary compareStateDict; - - public int recursion_depth = 0; - public TraceFunction tracefunc; + public TraceFunction profilefunc; - + + private LinkedList<PyInstance> initializingProxies; + + private PyDictionary compareStateDict; + public PyInstance getInitializingProxy() { - if (this.initializingProxies == null - || this.initializingProxies.empty()) { + if (initializingProxies == null) { return null; } - return (PyInstance) this.initializingProxies.peek(); + return initializingProxies.peek(); } public void pushInitializingProxy(PyInstance proxy) { - if (this.initializingProxies == null) { - this.initializingProxies = new Stack(); + if (initializingProxies == null) { + initializingProxies = new LinkedList<PyInstance>(); } - this.initializingProxies.push(proxy); + initializingProxies.push(proxy); } public void popInitializingProxy() { - if (this.initializingProxies == null - || this.initializingProxies.empty()) { + if (initializingProxies == null || initializingProxies.isEmpty()) { throw Py.RuntimeError("invalid initializing proxies state"); } - this.initializingProxies.pop(); + initializingProxies.pop(); } public ThreadState(Thread t, PySystemState systemState) { - this.thread = t; - // Fake multiple interpreter states for now - /* - * if (Py.interp == null) { Py.interp = - * InterpreterState.getInterpreterState(); } - */ this.systemState = systemState; - // interp = Py.interp; - this.tracing = false; - // System.out.println("new thread state"); + thread = t; } public boolean enterRepr(PyObject obj) { @@ -85,7 +73,6 @@ if (reprStack == null) { return; } - for (int i = reprStack.size() - 1; i >= 0; i--) { if (reprStack.pyget(i) == obj) { reprStack.delRange(i, reprStack.size(), 1); @@ -94,9 +81,9 @@ } public PyDictionary getCompareStateDict() { - if (this.compareStateDict == null) { - this.compareStateDict = new PyDictionary(); + if (compareStateDict == null) { + compareStateDict = new PyDictionary(); } - return this.compareStateDict; + return compareStateDict; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |