src/share/vm/opto/memnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/memnode.cpp	Wed Jun 29 15:34:15 2016
--- new/src/share/vm/opto/memnode.cpp	Wed Jun 29 15:34:15 2016

*** 1711,1733 **** --- 1711,1732 ---- #endif return jt; } } } else if (tp->base() == Type::InstPtr) { ciEnv* env = C->env(); const TypeInstPtr* tinst = tp->is_instptr(); ciKlass* klass = tinst->klass(); assert( off != Type::OffsetBot || // arrays can be cast to Objects tp->is_oopptr()->klass()->is_java_lang_Object() || // unsafe field access may not have a constant offset C->has_unsafe_access(), "Field accesses must be precise" ); // For oop loads, we expect the _type to be precise. // Optimizations for constant objects + + // Optimize loads from constant fields. + const TypeInstPtr* tinst = tp->is_instptr(); ciObject* const_oop = tinst->const_oop(); ! if (!is_mismatched_access() && off != Type::OffsetBot && const_oop != NULL && const_oop->is_instance()) { const Type* con_type = Type::make_constant_from_field(const_oop->as_instance(), off, is_unsigned(), memory_type()); if (con_type != NULL) { return con_type; } }

src/share/vm/opto/memnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File