/**
  * Returns the constant value which field <code>hf</code> is set to whenever the given constructor
  * is executed. Requires that <code>isConstant(constructor,hf)</code> be <code>true</code>.
  */
 public Object constantValue(HMethod constructor, HField hf) {
   assert isConstant(constructor, hf);
   Classification c = (Classification) classifyMethod(constructor).get(hf);
   return (c == null) ? makeZero(hf.getType()) : c.constant;
 }
예제 #2
0
 /** utility function copied from Interpret/Quads/Ref.java */
 static final Object defaultValue(HField f) {
   if (f.isConstant()) return f.getConstant();
   return defaultValue(f.getType());
 }