hotspot/src/share/vm/opto/memnode.cpp
changeset 6436 92ab86f565f8
parent 5889 13152be884e5
child 6741 d4e6d10d7bdf
--- a/hotspot/src/share/vm/opto/memnode.cpp	Mon Aug 30 11:02:53 2010 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Mon Aug 30 17:27:35 2010 -0700
@@ -1547,8 +1547,8 @@
         adr->is_AddP() && off != Type::OffsetBot) {
       // For constant Strings treat the fields as compile time constants.
       Node* base = adr->in(AddPNode::Base);
-      if (base->Opcode() == Op_ConP) {
-        const TypeOopPtr* t = phase->type(base)->isa_oopptr();
+      const TypeOopPtr* t = phase->type(base)->isa_oopptr();
+      if (t != NULL && t->singleton()) {
         ciObject* string = t->const_oop();
         ciConstant constant = string->as_instance()->field_value_by_offset(off);
         if (constant.basic_type() == T_INT) {