Applying Loop Optimizations to Object-Oriented Abstractions Through General Classification of Array Semantics