public CallStack getSnapshotAsCallStack() { CallStack stack = new CallStack(env); stack.callStack = new CallStackItem[callStack.length]; System.arraycopy(getSnapshot(), 0, stack.callStack, 0, callStackTop); stack.callStackTop = callStackTop; stack.maxCallStackTop = maxCallStackTop; return stack; }
public int getCallStackTop() { return getCallStack().getTop(); }
public DebugTick(Breakpoint breakpoint, Environment environment, TraceInfo trace, ArrayMemory locals) { this.breakpoint = breakpoint; this.environment = environment; this.trace = trace; this.locals = locals; this.callStack = environment == null ? null : environment.getCallStack().getSnapshotAsCallStack(); }
public ClassEntity getLastClassOnStack() { CallStack callStack = getCallStack(); int N = callStack.getTop(); for (int i = 0; i < N; i++) { CallStackItem item = callStack.peekCall(i); if (item != null && item.clazz != null) { if (item.classEntity != null) { if (item.object instanceof Closure) { Memory self = ((Closure) item.object).getSelf(); if (self.isObject()) return self.toValue(ObjectMemory.class).getReflection(); else { return null; } } return item.classEntity; } ClassEntity e = item.classEntity = fetchClass(item.clazz, false); if (e == null) { throw new IllegalStateException("Cannot find '" + item.clazz + "' in the current environment"); } return e; } } return null; }
public void pushCall(CallStackItem stackItem) { getCallStack().push(stackItem); }
public CallStackItem[] getCallStackSnapshot() { return getCallStack().getSnapshot(); }
public TraceInfo trace(){ if (callStackTop <= 0) return TraceInfo.UNKNOWN; return peekCall(0).trace; }
public TraceInfo trace(int systemOffsetStackTrace) { return getCallStack().trace(systemOffsetStackTrace); }
@Override protected CallStack initialValue() { return new CallStack(ConcurrentEnvironment.this); } };
public CallStackItem popCall() { return getCallStack().pop(); }
public CallStackItem pushCall(TraceInfo trace, IObject self, String method, Memory... args) { return getCallStack().push(trace, self, method, args); }
Collections.addAll(list, callStack.getSnapshot());
public CallStackItem peekCall(int depth) { return getCallStack().peekCall(depth); }
public TraceInfo trace() { return getCallStack().trace(); }
public CallStackItem pushCall(TraceInfo trace, IObject self, Memory[] args, String function, String clazz, String staticClazz) { return getCallStack().push(trace, self, args, function, clazz, staticClazz); }
public ModuleEntity module(int depth) { CallStackItem stackItem = peekCall(depth); if (stackItem != null) { return env.getModuleManager().findModule(stackItem.trace); } return null; }
public CallStackItem pushCall(IObject self, String method, Memory... args) { return getCallStack().push(self, method, args); }
public ModuleEntity module() { if (callStackTop <= 0) { return null; } return env.getModuleManager().findModule(peekCall(0).trace); }
public CallStackItem push(TraceInfo trace, IObject self, String method, Memory... args) { return push(trace, self, args, method, self.getReflection().getName(), null); }