< prev index next >

src/share/vm/opto/escape.cpp

Print this page

        

@@ -2095,12 +2095,11 @@
         // Ignore array length load.
       } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) {
         // Ignore first AddP.
       } else {
         const Type* elemtype = adr_type->isa_aryptr()->elem();
-        if (elemtype->isa_valuetype()) {
-          assert(field_offset != Type::OffsetBot, "invalid field offset");
+        if (elemtype->isa_valuetype() && field_offset != Type::OffsetBot) {
           ciValueKlass* vk = elemtype->is_valuetype()->value_klass();
           field_offset += vk->first_field_offset();
           bt = vk->get_field_by_offset(field_offset, false)->layout_type();
         } else {
           bt = elemtype->array_element_basic_type();

@@ -2113,11 +2112,13 @@
           n->has_out_with(Op_CompareAndSwapP, Op_CompareAndSwapN, Op_WeakCompareAndSwapP, Op_WeakCompareAndSwapN)) {
         bt = T_OBJECT;
       }
     }
   }
-  return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY);
+  // TODO enable when using T_VALUETYPEPTR
+  //assert(bt != T_VALUETYPE, "should not have valuetype here");
+  return (bt == T_OBJECT || bt == T_VALUETYPE || bt == T_VALUETYPEPTR || bt == T_NARROWOOP || bt == T_ARRAY);
 }
 
 // Returns unique pointed java object or NULL.
 JavaObjectNode* ConnectionGraph::unique_java_object(Node *n) {
   assert(!_collecting, "should not call when contructed graph");

@@ -3181,11 +3182,11 @@
         }
       } else if (use->Opcode() == Op_Return) {
         assert(_compile->tf()->returns_value_type_as_fields(), "must return a value type");
         // Get ValueKlass by removing the tag bit from the metadata pointer
         Node* klass = use->in(TypeFunc::Parms);
-        intptr_t ptr = (intptr_t)igvn->find_intptr_t_con(klass, -1);
+        intptr_t ptr = igvn->type(klass)->isa_rawptr()->get_con();
         clear_nth_bit(ptr, 0);
         assert(Metaspace::contains((void*)ptr), "should be klass");
         assert(((ValueKlass*)ptr)->contains_oops(), "returned value type must contain a reference field");
       } else {
         uint op = use->Opcode();
< prev index next >