@Override public int getRegisterCount(@Nonnull PoolMethod method) { MethodImplementation impl = method.getImplementation(); if (impl != null) { return impl.getRegisterCount(); } return 0; }
public MethodAnalyzer(@Nonnull ClassPath classPath, @Nonnull Method method, @Nullable InlineMethodResolver inlineResolver, boolean normalizeVirtualMethods) { this.classPath = classPath; this.inlineResolver = inlineResolver; this.normalizeVirtualMethods = normalizeVirtualMethods; this.method = method; MethodImplementation methodImpl = method.getImplementation(); if (methodImpl == null) { throw new IllegalArgumentException("The method has no implementation"); } this.methodImpl = methodImpl; // Override AnalyzedInstruction and provide custom implementations of some of the methods, so that we don't // have to handle the case this special case of instruction being null, in the main class startOfMethod = new AnalyzedInstruction(this, new ImmutableInstruction10x(Opcode.NOP), -1, methodImpl.getRegisterCount()) { @Override protected boolean addPredecessor(AnalyzedInstruction predecessor) { throw new UnsupportedOperationException(); } @Override @Nonnull public RegisterType getPredecessorRegisterType(@Nonnull AnalyzedInstruction predecessor, int registerNumber) { throw new UnsupportedOperationException(); } }; buildInstructionList(); analyzedState = new BitSet(analyzedInstructions.size()); paramRegisterCount = MethodUtil.getParameterRegisterCount(method); analyze(); }
int oldRegisterCount = builderMethod.getImplementation().getRegisterCount(); int registerCount = oldRegisterCount + invokeRegisterCount; setRegisterCount(builderMethod, registerCount); int oldRegisterCount = builderMethod.getImplementation().getRegisterCount(); int registerCount = oldRegisterCount + invokeRegisterCount; setRegisterCount(builderMethod, registerCount);
public BuilderMutableMethodImplementation(DexBuilder dexBuilder, @Nonnull MethodImplementation methodImplementation) { this.dexBuilder = dexBuilder; this.registerCount = methodImplementation.getRegisterCount();
numRegisters = code.getRegisterCount(); numParameterRegisters = MethodUtil.getParameterRegisterCount(method); if (!isStatic) {
MethodImplementation methodImpl = this.methodImpl; int totalRegisters = methodImpl.getRegisterCount(); int parameterRegisters = paramRegisterCount;
private void buildInstructionList() { int registerCount = methodImpl.getRegisterCount();
if (classDef.options.localsDirective) { writer.write(".locals "); writer.printSignedIntAsDec(methodImpl.getRegisterCount() - parameterRegisterCount); } else { writer.write(".registers "); writer.printSignedIntAsDec(methodImpl.getRegisterCount()); registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(), parameterRegisterCount);
@Override public int getRegisterCount() { return methodImplementation.getRegisterCount(); }
@Override public int getRegisterCount() { return methodImplementation.getRegisterCount(); }
/** * XXX not fully about the + 2. * @return the RegisterCount + 2 to make some room for the return and exception register * @see com.ibm.wala.classLoader.ShrikeCTMethod#getMaxLocals() */ public int getMaxLocals() { return eMethod.getImplementation().getRegisterCount() + 2; }
@Override public int getRegisterCount(@Nonnull PoolMethod method) { MethodImplementation impl = method.getImplementation(); if (impl != null) { return impl.getRegisterCount(); } return 0; }
@Override public int getRegisterCount(@Nonnull PoolMethod method) { MethodImplementation impl = method.getImplementation(); if (impl != null) { return impl.getRegisterCount(); } return 0; }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }
/** * XXX not fully about the + 2. * @return the RegisterCount + 2 to make some room for the return and exception register * @see com.ibm.wala.classLoader.ShrikeCTMethod#getMaxLocals() */ public int getMaxLocals() { return eMethod.getImplementation().getRegisterCount() + 2; }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }
public int getExceptionReg() { return eMethod.getImplementation().getRegisterCount()+1; }
public int getReturnReg() { return eMethod.getImplementation().getRegisterCount(); }
@Override protected MethodImplementation reMethodImpl(MethodImplementation methodImplementation) { if (methodImplementation == null){ return null; } Iterable<? extends Instruction> instructions = methodImplementation.getInstructions(); Iterable<? extends DebugItem> debugItems = methodImplementation.getDebugItems(); List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks = methodImplementation.getTryBlocks(); return new ImmutableMethodImplementation(methodImplementation.getRegisterCount(), reInstructions(instructions), reTryCatchBlock(methodImplementation.getTryBlocks()), reDebugItem(methodImplementation.getDebugItems())); }