Package org.armedbear.lisp
Class LispThread
- java.lang.Object
-
- org.armedbear.lisp.LispObject
-
- org.armedbear.lisp.LispThread
-
- All Implemented Interfaces:
Inspectable
public final class LispThread extends LispObject implements Inspectable
-
-
Field Summary
Fields Modifier and Type Field Description LispObject[]
_values
static Primitive
BACKTRACE
static Primitive
CURRENT_THREAD
java.util.Stack<Environment>
envStack
Stack holding bindings for evaluated functionsstatic Primitive
FRAME_TO_LIST
static Primitive
FRAME_TO_STRING
static Symbol
NATIVE_THREADS
static Primitive
OBJECT_NOTIFY
static Primitive
OBJECT_NOTIFY_ALL
static Primitive
OBJECT_WAIT
static SpecialOperator
SYNCHRONIZED_ON
static Symbol
VIRTUAL_THREADS
-
Method Summary
-
Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref, AREF, AREF, aref_long, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, equal, EQUAL, equalp, equalp, evenp, EVENP, execute, execute, execute, floatp, FLOATP, floatValue, getBooleanValue, getCallCount, getDescription, getDocumentation, getFixnumSlotValue, getHotCount, getInstance, getPropertyList, getSlotValue, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValueAsBoolean, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, incrementCallCount, incrementHotCount, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, javaInstance, javaInstance, LDB, length, LENGTH, listp, LISTP, lockableInstance, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, princToString, psxhash, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, setSlotValue, setSlotValue, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, SIMPLE_STRING_P, SLOT_VALUE, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, sxhash, SYMBOLP, truncate, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
-
-
-
-
Field Detail
-
_values
public LispObject[] _values
-
envStack
public java.util.Stack<Environment> envStack
Stack holding bindings for evaluated functions
-
NATIVE_THREADS
public static Symbol NATIVE_THREADS
-
VIRTUAL_THREADS
public static Symbol VIRTUAL_THREADS
-
CURRENT_THREAD
public static final Primitive CURRENT_THREAD
-
BACKTRACE
public static final Primitive BACKTRACE
-
FRAME_TO_STRING
public static final Primitive FRAME_TO_STRING
-
FRAME_TO_LIST
public static final Primitive FRAME_TO_LIST
-
SYNCHRONIZED_ON
public static final SpecialOperator SYNCHRONIZED_ON
-
OBJECT_WAIT
public static final Primitive OBJECT_WAIT
-
OBJECT_NOTIFY
public static final Primitive OBJECT_NOTIFY
-
OBJECT_NOTIFY_ALL
public static final Primitive OBJECT_NOTIFY_ALL
-
-
Method Detail
-
currentThread
public static final LispThread currentThread()
-
getParts
public LispObject getParts()
Description copied from class:LispObject
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject. The protocol is to return a List of Cons pairs, where the car of each pair contains a decriptive string, and the cdr returns a subobject for inspection.- Specified by:
getParts
in interfaceInspectable
- Overrides:
getParts
in classLispObject
-
virtualThreadingAvailable
public static boolean virtualThreadingAvailable()
-
getJavaStackTrace
public java.lang.StackTraceElement[] getJavaStackTrace()
-
typeOf
public LispObject typeOf()
- Overrides:
typeOf
in classLispObject
-
classOf
public LispObject classOf()
- Overrides:
classOf
in classLispObject
-
typep
public LispObject typep(LispObject typeSpecifier)
- Overrides:
typep
in classLispObject
-
isDestroyed
public final boolean isDestroyed()
-
getValues
public final LispObject[] getValues()
-
getValues
public final LispObject[] getValues(LispObject result, int count)
-
accumulateValues
public final LispObject[] accumulateValues(LispObject result, LispObject[] oldValues)
Used by the JVM compiler for MULTIPLE-VALUE-CALL.
-
setValues
public final LispObject setValues()
-
setValues
public final LispObject setValues(LispObject value1)
-
setValues
public final LispObject setValues(LispObject value1, LispObject value2)
-
setValues
public final LispObject setValues(LispObject value1, LispObject value2, LispObject value3)
-
setValues
public final LispObject setValues(LispObject value1, LispObject value2, LispObject value3, LispObject value4)
-
setValues
public final LispObject setValues(LispObject[] values)
-
clearValues
public final void clearValues()
-
nothing
public final LispObject nothing()
-
value
public final LispObject value(LispObject obj)
Force a single value, for situations where multiple values should be ignored.
-
markSpecialBindings
public final SpecialBindingsMark markSpecialBindings()
Marks the state of the special bindings, for later rewinding by resetSpecialBindings().
-
resetSpecialBindings
public final void resetSpecialBindings(SpecialBindingsMark mark)
Restores the state of the special bindings to what was captured in the marker 'mark' by a call to markSpecialBindings().
-
releaseSpecialIndex
protected static void releaseSpecialIndex(Symbol sym)
Frees up an index previously assigned to a symbol for re-assignment to another symbol. Returns without effect if the symbol has the default UNASSIGNED_SPECIAL_INDEX special index.
-
bindSpecial
public final SpecialBinding bindSpecial(Symbol name, LispObject value)
-
bindSpecialToCurrentValue
public final SpecialBinding bindSpecialToCurrentValue(Symbol name)
-
lookupSpecial
public final LispObject lookupSpecial(Symbol name)
Looks up the value of a special binding in the context of the given thread. In order to find the value of a special variable (in general), useSymbol.symbolValue()
.- Parameters:
name
- The name of the special variable, normally a symbol- Returns:
- The inner most binding of the special, or null if unbound
- See Also:
Symbol.symbolValue()
-
getSpecialBinding
public final SpecialBinding getSpecialBinding(Symbol name)
-
setSpecialVariable
public final LispObject setSpecialVariable(Symbol name, LispObject value)
-
pushSpecial
public final LispObject pushSpecial(Symbol name, LispObject thing)
-
safeSymbolValue
public final LispObject safeSymbolValue(Symbol name)
-
rebindSpecial
public final void rebindSpecial(Symbol name, LispObject value)
-
pushCatchTag
public void pushCatchTag(LispObject tag)
-
popCatchTag
public void popCatchTag()
-
throwToTag
public void throwToTag(LispObject tag, LispObject result)
-
pushStackFrame
public final void pushStackFrame(JavaStackFrame frame)
-
setEnv
public final Environment setEnv(Environment env)
-
resetStack
public void resetStack()
-
execute
public LispObject execute(LispObject function)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject arg)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third, LispObject fourth)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh)
- Overrides:
execute
in classLispObject
-
execute
public LispObject execute(LispObject function, LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh, LispObject eighth)
-
execute
public LispObject execute(LispObject function, LispObject[] args)
-
printBacktrace
public void printBacktrace()
-
printBacktrace
public void printBacktrace(int limit)
-
backtrace
public LispObject backtrace(int limit)
-
incrementCallCounts
public void incrementCallCounts()
-
printObject
public java.lang.String printObject()
- Overrides:
printObject
in classLispObject
-
-