/** * Constructs an instance. * * @param machine {@code non-null;} machine to use when simulating * @param method {@code non-null;} method data to use * @param dexOptions {@code non-null;} options for dex output */ public Simulator(Machine machine, ConcreteMethod method, DexOptions dexOptions) { if (machine == null) { throw new NullPointerException("machine == null"); } if (method == null) { throw new NullPointerException("method == null"); } if (dexOptions == null) { throw new NullPointerException("dexOptions == null"); } this.machine = machine; this.code = method.getCode(); this.method = method; this.localVariables = method.getLocalVariables(); this.visitor = new SimVisitor(); this.dexOptions = dexOptions; // This check assumes class is initialized (accesses dexOptions). if (method.isDefaultOrStaticInterfaceMethod()) { checkInterfaceMethodDeclaration(method); } }