@Override public TypeReference getReturnType() { return ref.getReturnType(); }
@Override public TypeReference getReturnType() { return ref.getReturnType(); }
public TypeReference getReturnType() { return method.getReturnType(); }
public TypeReference getReturnType() { return method.getReturnType(); }
/** * What is the declared return type of the called method */ public TypeReference getDeclaredResultType() { return site.getDeclaredTarget().getReturnType(); }
@Override public TypeReference getReturnType() { //compute the typeReference from the MethodIdItem if (typeReference == null) { typeReference = getReference().getReturnType(); } return typeReference; }
/** * What is the declared return type of the called method */ public TypeReference getDeclaredResultType() { return site.getDeclaredTarget().getReturnType(); }
@Override public TypeReference getReturnType() { //compute the typeReference from the MethodIdItem if (typeReference == null) { typeReference = getReference().getReturnType(); } return typeReference; }
/** * Handed through to the IMethod / MethodReference */ public TypeReference getReturnType() { switch (this.base) { case IMETHOD: return this.method.getReturnType(); case METHOD_REFERENCE: return this.mRef.getReturnType(); default: throw new UnsupportedOperationException("No implementation of getReturnType() for base " + this.base); } }
@Override public TypeReference getReturnType() { return getReference().getReturnType(); }
/** * Handed through to the IMethod / MethodReference */ public TypeReference getReturnType() { switch (this.base) { case IMETHOD: return this.method.getReturnType(); case METHOD_REFERENCE: return this.mRef.getReturnType(); default: throw new UnsupportedOperationException("No implementation of getReturnType() for base " + this.base); } }
@Override public TypeReference getReturnType() { return getReference().getReturnType(); }
@Override public TypeReference getReturnType() { return getReference().getReturnType(); }
@Override public TypeReference getReturnType() { return getReference().getReturnType(); }
/** * @return the invoke instructions added by this operation * @throws IllegalArgumentException if site is null */ public SSAAbstractInvokeInstruction addInvocation(int[] params, CallSiteReference site) { if (site == null) { throw new IllegalArgumentException("site is null"); } CallSiteReference newSite = CallSiteReference.make(statements.size(), site.getDeclaredTarget(), site.getInvocationCode()); SSAAbstractInvokeInstruction s = null; if (newSite.getDeclaredTarget().getReturnType().equals(TypeReference.Void)) { s = insts.InvokeInstruction(statements.size(), params, nextLocal++, newSite, null); } else { s = insts.InvokeInstruction(statements.size(), nextLocal++, params, nextLocal++, newSite, null); } statements.add(s); cache.invalidate(this, Everywhere.EVERYWHERE); return s; }
/** * @return the invoke instructions added by this operation * @throws IllegalArgumentException if site is null */ public SSAAbstractInvokeInstruction addInvocation(int[] params, CallSiteReference site) { if (site == null) { throw new IllegalArgumentException("site is null"); } CallSiteReference newSite = CallSiteReference.make(statements.size(), site.getDeclaredTarget(), site.getInvocationCode()); SSAAbstractInvokeInstruction s = null; if (newSite.getDeclaredTarget().getReturnType().equals(TypeReference.Void)) { s = insts.InvokeInstruction(statements.size(), params, nextLocal++, newSite, null); } else { s = insts.InvokeInstruction(statements.size(), nextLocal++, params, nextLocal++, newSite, null); } statements.add(s); cache.invalidate(this, Everywhere.EVERYWHERE); return s; }
public SSAAbstractInvokeInstruction addInvocation(int[] params, CallSiteReference site) { if (site == null) { throw new IllegalArgumentException("site is null"); } CallSiteReference newSite = CallSiteReference.make(methodSummary.getNumberOfStatements(), site.getDeclaredTarget(), site.getInvocationCode()); SSAAbstractInvokeInstruction s = null; if (newSite.getDeclaredTarget().getReturnType().equals(TypeReference.Void)) { s = insts.InvokeInstruction(methodSummary.getNumberOfStatements(), params, nextLocal++, newSite, null); } else { s = insts.InvokeInstruction(methodSummary.getNumberOfStatements(), nextLocal++, params, nextLocal++, newSite, null); } methodSummary.addStatement(s); // cache.invalidate(this, Everywhere.EVERYWHERE); return s; }
@Override protected void doCall(WalkContext context, CAstNode call, int result, int exception, CAstNode name, int receiver, int[] arguments) { assert name.getKind() == CAstNode.CONSTANT; CallSiteReference dummySiteRef = (CallSiteReference) name.getValue(); int pc = context.cfg().getCurrentInstruction(); boolean isStatic = (receiver == -1); int[] realArgs = isStatic ? arguments : new int[arguments.length + 1]; if (!isStatic) { realArgs[0] = receiver; System.arraycopy(arguments, 0, realArgs, 1, arguments.length); } CallSiteReference realSiteRef = CallSiteReference.make(pc, dummySiteRef.getDeclaredTarget(), dummySiteRef.getInvocationCode()); if (realSiteRef.getDeclaredTarget().getReturnType().equals(TypeReference.Void)) context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), realArgs, exception, realSiteRef)); else context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), result, realArgs, exception, realSiteRef)); processExceptions(call, context); }
@Override protected void doCall(WalkContext context, CAstNode call, int result, int exception, CAstNode name, int receiver, int[] arguments) { assert name.getKind() == CAstNode.CONSTANT; CallSiteReference dummySiteRef = (CallSiteReference) name.getValue(); int pc = context.cfg().getCurrentInstruction(); boolean isStatic = (receiver == -1); int[] realArgs = isStatic ? arguments : new int[arguments.length + 1]; if (!isStatic) { realArgs[0] = receiver; System.arraycopy(arguments, 0, realArgs, 1, arguments.length); } CallSiteReference realSiteRef = CallSiteReference.make(pc, dummySiteRef.getDeclaredTarget(), dummySiteRef.getInvocationCode()); if (realSiteRef.getDeclaredTarget().getReturnType().equals(TypeReference.Void)) context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), realArgs, exception, realSiteRef)); else context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), result, realArgs, exception, realSiteRef)); processExceptions(call, context); }
/** * If s is a call statement, return the statement representing the normal return from s */ public static Statement getReturnStatementForCall(Statement s) { if (s.getKind() == Kind.NORMAL) { NormalStatement n = (NormalStatement) s; SSAInstruction st = n.getInstruction(); if (st instanceof SSAInvokeInstruction) { SSAAbstractInvokeInstruction call = (SSAAbstractInvokeInstruction) st; if (call.getCallSite().getDeclaredTarget().getReturnType().equals(TypeReference.Void)) { throw new IllegalArgumentException("this driver computes forward slices from the return value of calls.\n" + "Method " + call.getCallSite().getDeclaredTarget().getSignature() + " returns void."); } return new NormalReturnCaller(s.getNode(), n.getInstructionIndex()); } else { return s; } } else { return s; } }