public State getState() {
		if (timeout == 0) {
			if (callFrame == null) {
				if (exception == null) {
					return State.TERMINATED;
				}
				return State.ERRORED;
			}
			if (generator && caller == null) {
				return State.YIELDING;
			}
			if (calling != null) {
				return State.GENERATOR_WAIT;
			}
			return State.RUNNING;
		} else if (timeout > 0) {
			return State.WAITING_TIMED;
		}
		return State.WAITING;
	}