hotspot/src/share/vm/oops/constantPool.cpp
changeset 15799 6aa92f9debd2
parent 15445 3a166138739c
child 16383 57cb9d398a11
equal deleted inserted replaced
15798:cea39eefa98e 15799:6aa92f9debd2
   691     if (this_oop->is_pseudo_string_at(index)) {
   691     if (this_oop->is_pseudo_string_at(index)) {
   692       result_oop = this_oop->pseudo_string_at(index, cache_index);
   692       result_oop = this_oop->pseudo_string_at(index, cache_index);
   693       break;
   693       break;
   694     }
   694     }
   695     result_oop = string_at_impl(this_oop, index, cache_index, CHECK_NULL);
   695     result_oop = string_at_impl(this_oop, index, cache_index, CHECK_NULL);
   696     break;
       
   697 
       
   698   case JVM_CONSTANT_Object:
       
   699     result_oop = this_oop->object_at(index);
       
   700     break;
   696     break;
   701 
   697 
   702   case JVM_CONSTANT_MethodHandleInError:
   698   case JVM_CONSTANT_MethodHandleInError:
   703   case JVM_CONSTANT_MethodTypeInError:
   699   case JVM_CONSTANT_MethodTypeInError:
   704     {
   700     {
  1822   EXCEPTION_MARK;
  1818   EXCEPTION_MARK;
  1823   assert(is_constantPool(), "must be constantPool");
  1819   assert(is_constantPool(), "must be constantPool");
  1824   st->print_cr(internal_name());
  1820   st->print_cr(internal_name());
  1825   if (flags() != 0) {
  1821   if (flags() != 0) {
  1826     st->print(" - flags: 0x%x", flags());
  1822     st->print(" - flags: 0x%x", flags());
  1827     if (has_pseudo_string()) st->print(" has_pseudo_string");
       
  1828     if (has_invokedynamic()) st->print(" has_invokedynamic");
       
  1829     if (has_preresolution()) st->print(" has_preresolution");
  1823     if (has_preresolution()) st->print(" has_preresolution");
  1830     if (on_stack()) st->print(" on_stack");
  1824     if (on_stack()) st->print(" on_stack");
  1831     st->cr();
  1825     st->cr();
  1832   }
  1826   }
  1833   if (pool_holder() != NULL) {
  1827   if (pool_holder() != NULL) {
  1867     case JVM_CONSTANT_InterfaceMethodref :
  1861     case JVM_CONSTANT_InterfaceMethodref :
  1868       st->print("klass_index=%d", uncached_klass_ref_index_at(index));
  1862       st->print("klass_index=%d", uncached_klass_ref_index_at(index));
  1869       st->print(" name_and_type_index=%d", uncached_name_and_type_ref_index_at(index));
  1863       st->print(" name_and_type_index=%d", uncached_name_and_type_ref_index_at(index));
  1870       break;
  1864       break;
  1871     case JVM_CONSTANT_String :
  1865     case JVM_CONSTANT_String :
  1872       unresolved_string_at(index)->print_value_on(st);
  1866       if (is_pseudo_string_at(index)) {
       
  1867         oop anObj = pseudo_string_at(index);
       
  1868         anObj->print_value_on(st);
       
  1869         st->print(" {0x%lx}", (address)anObj);
       
  1870       } else {
       
  1871         unresolved_string_at(index)->print_value_on(st);
       
  1872       }
  1873       break;
  1873       break;
  1874     case JVM_CONSTANT_Object : {
       
  1875       oop anObj = object_at(index);
       
  1876       anObj->print_value_on(st);
       
  1877       st->print(" {0x%lx}", (address)anObj);
       
  1878       } break;
       
  1879     case JVM_CONSTANT_Integer :
  1874     case JVM_CONSTANT_Integer :
  1880       st->print("%d", int_at(index));
  1875       st->print("%d", int_at(index));
  1881       break;
  1876       break;
  1882     case JVM_CONSTANT_Float :
  1877     case JVM_CONSTANT_Float :
  1883       st->print("%f", float_at(index));
  1878       st->print("%f", float_at(index));
  1937 }
  1932 }
  1938 
  1933 
  1939 void ConstantPool::print_value_on(outputStream* st) const {
  1934 void ConstantPool::print_value_on(outputStream* st) const {
  1940   assert(is_constantPool(), "must be constantPool");
  1935   assert(is_constantPool(), "must be constantPool");
  1941   st->print("constant pool [%d]", length());
  1936   st->print("constant pool [%d]", length());
  1942   if (has_pseudo_string()) st->print("/pseudo_string");
       
  1943   if (has_invokedynamic()) st->print("/invokedynamic");
       
  1944   if (has_preresolution()) st->print("/preresolution");
  1937   if (has_preresolution()) st->print("/preresolution");
  1945   if (operands() != NULL)  st->print("/operands[%d]", operands()->length());
  1938   if (operands() != NULL)  st->print("/operands[%d]", operands()->length());
  1946   print_address_on(st);
  1939   print_address_on(st);
  1947   st->print(" for ");
  1940   st->print(" for ");
  1948   pool_holder()->print_value_on(st);
  1941   pool_holder()->print_value_on(st);