/** * Returns whether the first whether the first instructions of the * given code attribute match with the given instruction matcher. */ private boolean isDotClassMethodCode(Clazz clazz, Method method, CodeAttribute codeAttribute, InstructionSequenceMatcher codeMatcher, int codeLength) { // Check the minimum code length. if (codeAttribute.u4codeLength < codeLength) { return false; } // Check the actual instructions. codeMatcher.reset(); codeAttribute.instructionsAccept(clazz, method, 0, codeLength, codeMatcher); return codeMatcher.isMatching(); }
/** * Returns whether the first whether the first instructions of the * given code attribute match with the given instruction matcher. */ private boolean isDotClassMethodCode(Clazz clazz, Method method, CodeAttribute codeAttribute, InstructionSequenceMatcher codeMatcher, int codeLength) { // Check the minimum code length. if (codeAttribute.u4codeLength < codeLength) { return false; } // Check the actual instructions. codeMatcher.reset(); codeAttribute.instructionsAccept(clazz, method, 0, codeLength, codeMatcher); return codeMatcher.isMatching(); }
/** * Returns whether the first whether the first instructions of the * given code attribute match with the given instruction matcher. */ private boolean isDotClassMethodCode(Clazz clazz, Method method, CodeAttribute codeAttribute, InstructionSequenceMatcher codeMatcher, int codeLength) { // Check the minimum code length. if (codeAttribute.u4codeLength < codeLength) { return false; } // Check the actual instructions. codeMatcher.reset(); codeAttribute.instructionsAccept(clazz, method, 0, codeLength, codeMatcher); return codeMatcher.isMatching(); }
/** * Returns whether the first whether the first instructions of the * given code attribute match with the given instruction matcher. */ private boolean isDotClassMethodCode(Clazz clazz, Method method, CodeAttribute codeAttribute, InstructionSequenceMatcher codeMatcher, int codeLength) { // Check the minimum code length. if (codeAttribute.u4codeLength < codeLength) { return false; } // Check the actual instructions. codeMatcher.reset(); codeAttribute.instructionsAccept(clazz, method, 0, codeLength, codeMatcher); return codeMatcher.isMatching(); }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Is the initializer initializing the field? if (codeAttribute.u4codeLength == 10) { INITIALIZER_MATCHER.reset(); codeAttribute.instructionsAccept(clazz, method, INITIALIZER_MATCHER); if (INITIALIZER_MATCHER.isMatching()) { String initializerClassName = clazz.getName(); String fieldClassName = clazz.getClassName(INITIALIZER_MATCHER.matchedConstantIndex(InstructionSequenceMatcher.A)); if (fieldClassName.equals(initializerClassName)) { wrapCounter++; } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Is the initializer initializing the field? if (codeAttribute.u4codeLength == 10) { INITIALIZER_MATCHER.reset(); codeAttribute.instructionsAccept(clazz, method, INITIALIZER_MATCHER); if (INITIALIZER_MATCHER.isMatching()) { String initializerClassName = clazz.getName(); String fieldClassName = clazz.getClassName(INITIALIZER_MATCHER.matchedConstantIndex(InstructionSequenceMatcher.A)); if (fieldClassName.equals(initializerClassName)) { wrapCounter++; } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Is the initializer initializing the field? if (codeAttribute.u4codeLength == 10) { INITIALIZER_MATCHER.reset(); codeAttribute.instructionsAccept(clazz, method, INITIALIZER_MATCHER); if (INITIALIZER_MATCHER.isMatching()) { String initializerClassName = clazz.getName(); String fieldClassName = clazz.getClassName(INITIALIZER_MATCHER.matchedConstantIndex(InstructionSequenceMatcher.A)); if (fieldClassName.equals(initializerClassName)) { wrapCounter++; } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } }
if (constantSequenceMatcher.isMatching()) if (variableSequenceMatcher.isMatching())
if (constantClassForNameMatcher.isMatching()) if (classForNameCastMatcher.isMatching()) if (dotClassJavacMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJavacMatcher.matchedConstantIndex(0))) if (dotClassJikesMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJikesMatcher.matchedConstantIndex(0)))
if (classForNameCastMatcher.isMatching()) if (constantClassForNameMatcher.isMatching()) if (dotClassJavacMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJavacMatcher.matchedConstantIndex(0))) if (dotClassJikesMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJikesMatcher.matchedConstantIndex(0)))
if (classForNameCastMatcher.isMatching()) if (constantClassForNameMatcher.isMatching()) if (dotClassJavacMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJavacMatcher.matchedConstantIndex(0))) if (dotClassJikesMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJikesMatcher.matchedConstantIndex(0)))
if (classForNameCastMatcher.isMatching()) if (constantClassForNameMatcher.isMatching()) if (dotClassJavacMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJavacMatcher.matchedConstantIndex(0))) if (dotClassJikesMatcher.isMatching() && isDotClassMethodref(clazz, dotClassJikesMatcher.matchedConstantIndex(0)))
if (arrayPreStoreMatcher.isMatching())
if (arrayPreStoreMatcher.isMatching())
if (arrayPreStoreMatcher.isMatching())
if (instructionSequenceMatcher.isMatching() && matchedInstructionsUnmodified())
if (instructionSequenceMatcher.isMatching() && matchedInstructionsUnmodified())