< prev index next >

src/hotspot/share/opto/buildOopMap.cpp

Print this page
@@ -351,10 +351,11 @@
          omap->set_callee_saved( r, callee);
        }
  
      } else {
        // Other - some reaching non-oop value
+       // omap->set_value( r);
  #ifdef ASSERT
        if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) {
          def->dump();
          n->dump();
          assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint");

@@ -375,15 +376,17 @@
    }
    */
  #endif
  
  #ifdef ASSERT
+   bool has_derived_oops = false;
    for( OopMapStream oms1(omap); !oms1.is_done(); oms1.next()) {
      OopMapValue omv1 = oms1.current();
      if (omv1.type() != OopMapValue::derived_oop_value) {
        continue;
      }
+     has_derived_oops = true;
      bool found = false;
      for( OopMapStream oms2(omap); !oms2.is_done(); oms2.next()) {
        OopMapValue omv2 = oms2.current();
        if (omv2.type() != OopMapValue::oop_value) {
          continue;

@@ -391,12 +394,21 @@
        if( omv1.content_reg() == omv2.reg() ) {
          found = true;
          break;
        }
      }
+     assert(has_derived_oops == omap->has_derived_oops(), "");
      assert( found, "derived with no base in oopmap" );
    }
+ 
+   int num_oops = 0;
+   for (OopMapStream oms2(omap); !oms2.is_done(); oms2.next()) {
+     OopMapValue omv = oms2.current();
+     if (omv.type() == OopMapValue::oop_value || omv.type() == OopMapValue::narrowoop_value)
+       num_oops++;
+   }
+   assert (num_oops == omap->num_oops(), "num_oops: %d omap->num_oops(): %d", num_oops, omap->num_oops());
  #endif
  
    return omap;
  }
  
< prev index next >