2
* ProGuard -- shrinking, optimization, obfuscation, and preverification
5
* Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
7
* This library is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License as published by the Free
9
* Software Foundation; either version 2 of the License, or (at your option)
12
* This library is distributed in the hope that it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this library; if not, write to the Free Software Foundation,
19
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
package proguard.optimize.evaluation;
23
import proguard.classfile.*;
24
import proguard.classfile.constant.RefConstant;
25
import proguard.evaluation.BasicInvocationUnit;
26
import proguard.evaluation.value.*;
29
* This InvocationUbit loads parameter values and return values that were
30
* previously stored with the methods that are invoked.
32
* @see StoringInvocationUnit
33
* @author Eric Lafortune
35
public class LoadingInvocationUnit
36
extends BasicInvocationUnit
38
// Implementations for BasicInvocationUnit.
40
protected Value getFieldClassValue(Clazz clazz,
41
RefConstant refConstant,
44
Member referencedMember = refConstant.referencedMember;
45
if (referencedMember != null)
47
ReferenceValue value = StoringInvocationUnit.getFieldClassValue((Field)referencedMember);
54
return super.getFieldClassValue(clazz, refConstant, type);
58
protected Value getFieldValue(Clazz clazz,
59
RefConstant refConstant,
62
Member referencedMember = refConstant.referencedMember;
63
if (referencedMember != null)
65
Value value = StoringInvocationUnit.getFieldValue((Field)referencedMember);
72
return super.getFieldValue(clazz, refConstant, type);
76
protected Value getMethodParameterValue(Clazz clazz,
80
Clazz referencedClass)
82
Value value = StoringInvocationUnit.getMethodParameterValue(method, parameterIndex);
88
return super.getMethodParameterValue(clazz,
96
protected Value getMethodReturnValue(Clazz clazz,
97
RefConstant refConstant,
100
Member referencedMember = refConstant.referencedMember;
101
if (referencedMember != null)
103
Value value = StoringInvocationUnit.getMethodReturnValue((Method)referencedMember);
110
return super.getMethodReturnValue(clazz,