public Verifier(ClassVisitor cv, boolean unsafe, ExtensionsRepository eLocator) { super(Opcodes.ASM4, cv); this.unsafe = unsafe; onMethods = new ArrayList<OnMethod>(); onProbes = new ArrayList<OnProbe>(); cycleDetector = new CycleDetector(); ctValidator = new CallTargetValidator(eLocator); }
public boolean isCallTargetValid(String name, int numArgs) { for(String extName : repository.listExtensions()) { if (hasMethod(repository.loadExtension(extName), name, numArgs)) return true; } return false; }
ctValidator.isCallTargetValid(name, numArgs) || isSharedMethod(name, numArgs)) { return super.visitMethodInvocation(node, v); clzName.startsWith("BTraceUtils.") || clzName.startsWith("net.java.btrace.BTraceUtils.") || ctValidator.isClassValid(clzName)) { numArgs = args.size(); if (ctValidator.isCallTargetValid(name, numArgs)) { return super.visitMethodInvocation(node, v);
if ((inlineConcatLevel == 0 || !Type.getInternalName(StringBuilder.class).equals(owner)) && !ctValidator.isCallTargetValid(owner, name, args.length)) { reportError("no.method.calls", owner + "." + name + desc); if (!ctValidator.isCallTargetValid(owner, name, args.length)) { reportError("no.method.calls", owner + "." + name + desc); if (owner.equals(JAVA_LANG_OBJECT) && name.equals(CONSTRUCTOR)) { } else { if (!ctValidator.isCallTargetValid(owner, name, args.length)) { reportError("no.method.calls", owner + "." + name + desc); if (!ctValidator.isCallTargetValid(owner, name, args.length) && !owner.equals(className)) { if ("valueOf".equals(name) && isPrimitiveWrapper(owner)) {
ctValidator.isCallTargetValid(name, numArgs) || isSharedMethod(name, numArgs)) { return super.visitMethodInvocation(node, v); clzName.startsWith("BTraceUtils.") || clzName.startsWith("net.java.btrace.BTraceUtils.") || ctValidator.isClassValid(clzName)) { numArgs = args.size(); if (ctValidator.isCallTargetValid(name, numArgs)) { return super.visitMethodInvocation(node, v);
Boolean targetVal = simulatedStack.poll(); if (targetVal != null && targetVal) { // "true" on stack means the original reference to "this" if (!ctValidator.isCallTargetValid(clazz, method, args.length)) { // including only the in-script method invocations opcode = Opcodes.INVOKESTATIC;
options, null, compUnits); CallTargetValidator ctValidator = new CallTargetValidator(repository); Verifier btraceVerifier = new Verifier(ctValidator, unsafe); task.setTaskListener(btraceVerifier);
Boolean targetVal = simulatedStack.poll(); if (targetVal != null && targetVal) { // "true" on stack means the original reference to "this" if (!ctValidator.isCallTargetValid(clazz, method, args.length)) { // including only the in-script method invocations opcode = Opcodes.INVOKESTATIC;
public boolean isCallTargetValid(String name, int numArgs) { for(String extName : repository.listExtensions()) { if (hasMethod(repository.loadExtension(extName), name, numArgs)) return true; } return false; }
options, null, compUnits); CallTargetValidator ctValidator = new CallTargetValidator(repository); Verifier btraceVerifier = new Verifier(ctValidator, unsafe); task.setTaskListener(btraceVerifier);