public void pushCall(CallStackItem stackItem) { getCallStack().push(stackItem); }
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 CallStackItem pushCall(TraceInfo trace, IObject self, String method, Memory... args) { return getCallStack().push(trace, self, method, args); }
public CallStackItem popCall() { return getCallStack().pop(); }
public int getCallStackTop() { return getCallStack().getTop(); }
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 CallStackItem pushCall(IObject self, String method, Memory... args) { return getCallStack().push(self, method, args); }
public CallStackItem peekCall(int depth) { return getCallStack().peekCall(depth); }
public TraceInfo trace() { return getCallStack().trace(); }
public TraceInfo trace(int systemOffsetStackTrace) { return getCallStack().trace(systemOffsetStackTrace); }
public CallStackItem[] getCallStackSnapshot() { return getCallStack().getSnapshot(); }
public CallStackItem pushCallEx(TraceInfo trace, IObject self, Memory[] args, String function, ClassEntity clazz, String staticClazz) { CallStackItem stackItem = new CallStackItem(trace, self, args, function, clazz.getName(), staticClazz); stackItem.classEntity = clazz; return getCallStack().push(stackItem); }
public CallStackItem pushCallEx(TraceInfo trace, IObject self, Memory[] args, String function, ClassEntity clazz, ClassEntity staticClazz) { CallStackItem stackItem = new CallStackItem(trace, self, args, function, clazz.getName(), staticClazz.getName()); stackItem.classEntity = clazz; stackItem.staticClassEntity = staticClazz; return getCallStack().push(stackItem); }
public Generator(final Environment env, ClassEntity generator, Memory self, Memory[] uses) { super(env, generator); if (generator == null) { throw new CriticalException("Unable to create generator"); } env.registerObjectInGC(this); this.self = self; this.uses = uses; CallStackItem stackItem = env.peekCall(0); this.callStack = env.getCallStack(); this.callStackItem = stackItem == null ? null : new CallStackItem(stackItem); gen = new php.runtime.util.generator.Generator<Bucket>() { @Override protected void run(YieldAdapterIterator<Bucket> yieldAdapter) { try { currentGenerator.set(Generator.this); env.__replaceCallStack(Generator.this.callStack); Generator.this._run(env); } catch (Throwable e) { lastThrowable = e; Generator.this.setCurrent(Memory.NULL); } } }; iterator = gen.iterator(); }
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; }