public ProgramFieldOptimizationInfo(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); isWritten = isRead = (accessFlags & ClassConstants.ACC_VOLATILE) != 0; resetValue(clazz, field); }
public ProgramFieldOptimizationInfo(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); isWritten = isRead = (accessFlags & ClassConstants.ACC_VOLATILE) != 0; resetValue(clazz, field); }
public ProgramFieldOptimizationInfo(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); isWritten = isRead = (accessFlags & ClassConstants.ACC_VOLATILE) != 0; resetValue(clazz, field); }
public FieldOptimizationInfo(Clazz clazz, Field field) { isWritten = isRead = (field.getAccessFlags() & ClassConstants.INTERNAL_ACC_VOLATILE) != 0; value = initialValue(field.getDescriptor(clazz)); }
public void resetValue(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); value = null; // See if we can initialize the static field with a constant value. if ((accessFlags & ClassConstants.ACC_STATIC) != 0) { field.accept(clazz, new AllAttributeVisitor(this)); } // Otherwise initialize a non-final field with the default value. // Conservatively, even a final field needs to be initialized with the // default value, because it may be accessed before it is set. if (value == null && (SideEffectInstructionChecker.OPTIMIZE_CONSERVATIVELY || (accessFlags & ClassConstants.ACC_FINAL) == 0)) { // Otherwise initialize the non-final field with the default value. value = INITIAL_VALUE_FACTORY.createValue(field.getDescriptor(clazz)); } }
public void resetValue(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); value = null; // See if we can initialize the static field with a constant value. if ((accessFlags & ClassConstants.ACC_STATIC) != 0) { field.accept(clazz, new AllAttributeVisitor(this)); } // Otherwise initialize a non-final field with the default value. // Conservatively, even a final field needs to be initialized with the // default value, because it may be accessed before it is set. if (value == null && (SideEffectInstructionChecker.OPTIMIZE_CONSERVATIVELY || (accessFlags & ClassConstants.ACC_FINAL) == 0)) { // Otherwise initialize the non-final field with the default value. value = INITIAL_VALUE_FACTORY.createValue(field.getDescriptor(clazz)); } }
public void resetValue(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); value = null; // See if we can initialize the static field with a constant value. if ((accessFlags & ClassConstants.ACC_STATIC) != 0) { field.accept(clazz, new AllAttributeVisitor(this)); } // Otherwise initialize a non-final field with the default value. // Conservatively, even a final field needs to be initialized with the // default value, because it may be accessed before it is set. if (value == null && (SideEffectInstructionChecker.OPTIMIZE_CONSERVATIVELY || (accessFlags & ClassConstants.ACC_FINAL) == 0)) { // Otherwise initialize the non-final field with the default value. value = INITIAL_VALUE_FACTORY.createValue(field.getDescriptor(clazz)); } }