src/share/vm/oops/constantPoolOop.cpp

changeset 2497
3582bf76420e
parent 2353
dad31fc330cd
child 2614
fbbeec6dad2d
     1.1 --- a/src/share/vm/oops/constantPoolOop.cpp	Thu Jan 27 13:42:28 2011 -0800
     1.2 +++ b/src/share/vm/oops/constantPoolOop.cpp	Thu Jan 27 16:11:27 2011 -0800
     1.3 @@ -52,13 +52,14 @@
     1.4  }
     1.5  
     1.6  klassOop constantPoolOopDesc::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS) {
     1.7 -  // A resolved constantPool entry will contain a klassOop, otherwise a symbolOop.
     1.8 +  // A resolved constantPool entry will contain a klassOop, otherwise a Symbol*.
     1.9    // It is not safe to rely on the tag bit's here, since we don't have a lock, and the entry and
    1.10    // tag is not updated atomicly.
    1.11 -  oop entry = *(this_oop->obj_at_addr(which));
    1.12 -  if (entry->is_klass()) {
    1.13 +  CPSlot entry = this_oop->slot_at(which);
    1.14 +  if (entry.is_oop()) {
    1.15 +    assert(entry.get_oop()->is_klass(), "must be");
    1.16      // Already resolved - return entry.
    1.17 -    return (klassOop)entry;
    1.18 +    return (klassOop)entry.get_oop();
    1.19    }
    1.20  
    1.21    // Acquire lock on constant oop while doing update. After we get the lock, we check if another object
    1.22 @@ -67,7 +68,7 @@
    1.23    bool do_resolve = false;
    1.24    bool in_error = false;
    1.25  
    1.26 -  symbolHandle name;
    1.27 +  Symbol* name = NULL;
    1.28    Handle       loader;
    1.29    { ObjectLocker ol(this_oop, THREAD);
    1.30  
    1.31 @@ -76,7 +77,7 @@
    1.32          in_error = true;
    1.33        } else {
    1.34          do_resolve = true;
    1.35 -        name   = symbolHandle(THREAD, this_oop->unresolved_klass_at(which));
    1.36 +        name   = this_oop->unresolved_klass_at(which);
    1.37          loader = Handle(THREAD, instanceKlass::cast(this_oop->pool_holder())->class_loader());
    1.38        }
    1.39      }
    1.40 @@ -86,8 +87,8 @@
    1.41    // The original attempt to resolve this constant pool entry failed so find the
    1.42    // original error and throw it again (JVMS 5.4.3).
    1.43    if (in_error) {
    1.44 -    symbolOop error = SystemDictionary::find_resolution_error(this_oop, which);
    1.45 -    guarantee(error != (symbolOop)NULL, "tag mismatch with resolution error table");
    1.46 +    Symbol* error = SystemDictionary::find_resolution_error(this_oop, which);
    1.47 +    guarantee(error != (Symbol*)NULL, "tag mismatch with resolution error table");
    1.48      ResourceMark rm;
    1.49      // exception text will be the class name
    1.50      const char* className = this_oop->unresolved_klass_at(which)->as_C_string();
    1.51 @@ -110,7 +111,7 @@
    1.52      // to resolve this constant pool entry fail with the same error (JVMS 5.4.3).
    1.53      if (HAS_PENDING_EXCEPTION) {
    1.54        ResourceMark rm;
    1.55 -      symbolHandle error(PENDING_EXCEPTION->klass()->klass_part()->name());
    1.56 +      Symbol* error = PENDING_EXCEPTION->klass()->klass_part()->name();
    1.57  
    1.58        bool throw_orig_error = false;
    1.59        {
    1.60 @@ -120,7 +121,7 @@
    1.61          if (this_oop->tag_at(which).is_klass()) {
    1.62            CLEAR_PENDING_EXCEPTION;
    1.63            entry = this_oop->resolved_klass_at(which);
    1.64 -          return (klassOop)entry;
    1.65 +          return (klassOop)entry.get_oop();
    1.66          }
    1.67  
    1.68          if (!PENDING_EXCEPTION->
    1.69 @@ -135,8 +136,8 @@
    1.70            this_oop->tag_at_put(which, JVM_CONSTANT_UnresolvedClassInError);
    1.71          } else {
    1.72            // some other thread has put the class in error state.
    1.73 -          error = symbolHandle(SystemDictionary::find_resolution_error(this_oop, which));
    1.74 -          assert(!error.is_null(), "checking");
    1.75 +          error = SystemDictionary::find_resolution_error(this_oop, which);
    1.76 +          assert(error != NULL, "checking");
    1.77            throw_orig_error = true;
    1.78          }
    1.79        } // unlocked
    1.80 @@ -162,7 +163,7 @@
    1.81          vframeStream vfst(JavaThread::current());
    1.82          if (!vfst.at_end()) {
    1.83            line_number = vfst.method()->line_number_from_bci(vfst.bci());
    1.84 -          symbolOop s = instanceKlass::cast(vfst.method()->method_holder())->source_file_name();
    1.85 +          Symbol* s = instanceKlass::cast(vfst.method()->method_holder())->source_file_name();
    1.86            if (s != NULL) {
    1.87              source_file = s->as_C_string();
    1.88            }
    1.89 @@ -192,8 +193,8 @@
    1.90    }
    1.91  
    1.92    entry = this_oop->resolved_klass_at(which);
    1.93 -  assert(entry->is_klass(), "must be resolved at this point");
    1.94 -  return (klassOop)entry;
    1.95 +  assert(entry.is_oop() && entry.get_oop()->is_klass(), "must be resolved at this point");
    1.96 +  return (klassOop)entry.get_oop();
    1.97  }
    1.98  
    1.99  
   1.100 @@ -202,13 +203,14 @@
   1.101  // instanceof operations. Returns NULL if the class has not been loaded or
   1.102  // if the verification of constant pool failed
   1.103  klassOop constantPoolOopDesc::klass_at_if_loaded(constantPoolHandle this_oop, int which) {
   1.104 -  oop entry = *this_oop->obj_at_addr(which);
   1.105 -  if (entry->is_klass()) {
   1.106 -    return (klassOop)entry;
   1.107 +  CPSlot entry = this_oop->slot_at(which);
   1.108 +  if (entry.is_oop()) {
   1.109 +    assert(entry.get_oop()->is_klass(), "must be");
   1.110 +    return (klassOop)entry.get_oop();
   1.111    } else {
   1.112 -    assert(entry->is_symbol(), "must be either symbol or klass");
   1.113 +    assert(entry.is_metadata(), "must be either symbol or klass");
   1.114      Thread *thread = Thread::current();
   1.115 -    symbolHandle name (thread, (symbolOop)entry);
   1.116 +    Symbol* name = entry.get_symbol();
   1.117      oop loader = instanceKlass::cast(this_oop->pool_holder())->class_loader();
   1.118      oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain();
   1.119      Handle h_prot (thread, protection_domain);
   1.120 @@ -244,12 +246,13 @@
   1.121  // Note: We cannot update the ConstantPool from the vm_thread.
   1.122  klassOop constantPoolOopDesc::klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int index, TRAPS) {
   1.123    int which = this_oop->klass_ref_index_at(index);
   1.124 -  oop entry = *this_oop->obj_at_addr(which);
   1.125 -  if (entry->is_klass()) {
   1.126 -    return (klassOop)entry;
   1.127 +  CPSlot entry = this_oop->slot_at(which);
   1.128 +  if (entry.is_oop()) {
   1.129 +    assert(entry.get_oop()->is_klass(), "must be");
   1.130 +    return (klassOop)entry.get_oop();
   1.131    } else {
   1.132 -    assert(entry->is_symbol(), "must be either symbol or klass");
   1.133 -    symbolHandle name (THREAD, (symbolOop)entry);
   1.134 +    assert(entry.is_metadata(), "must be either symbol or klass");
   1.135 +    Symbol*  name  = entry.get_symbol();
   1.136      oop loader = instanceKlass::cast(this_oop->pool_holder())->class_loader();
   1.137      oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain();
   1.138      Handle h_loader(THREAD, loader);
   1.139 @@ -263,13 +266,13 @@
   1.140  }
   1.141  
   1.142  
   1.143 -symbolOop constantPoolOopDesc::impl_name_ref_at(int which, bool uncached) {
   1.144 +Symbol* constantPoolOopDesc::impl_name_ref_at(int which, bool uncached) {
   1.145    int name_index = name_ref_index_at(impl_name_and_type_ref_index_at(which, uncached));
   1.146    return symbol_at(name_index);
   1.147  }
   1.148  
   1.149  
   1.150 -symbolOop constantPoolOopDesc::impl_signature_ref_at(int which, bool uncached) {
   1.151 +Symbol* constantPoolOopDesc::impl_signature_ref_at(int which, bool uncached) {
   1.152    int signature_index = signature_ref_index_at(impl_name_and_type_ref_index_at(which, uncached));
   1.153    return symbol_at(signature_index);
   1.154  }
   1.155 @@ -361,39 +364,40 @@
   1.156  }
   1.157  
   1.158  
   1.159 -symbolOop constantPoolOopDesc::klass_name_at(int which) {
   1.160 +Symbol* constantPoolOopDesc::klass_name_at(int which) {
   1.161    assert(tag_at(which).is_unresolved_klass() || tag_at(which).is_klass(),
   1.162           "Corrupted constant pool");
   1.163 -  // A resolved constantPool entry will contain a klassOop, otherwise a symbolOop.
   1.164 +  // A resolved constantPool entry will contain a klassOop, otherwise a Symbol*.
   1.165    // It is not safe to rely on the tag bit's here, since we don't have a lock, and the entry and
   1.166    // tag is not updated atomicly.
   1.167 -  oop entry = *(obj_at_addr(which));
   1.168 -  if (entry->is_klass()) {
   1.169 +  CPSlot entry = slot_at(which);
   1.170 +  if (entry.is_oop()) {
   1.171      // Already resolved - return entry's name.
   1.172 -    return klassOop(entry)->klass_part()->name();
   1.173 +    assert(entry.get_oop()->is_klass(), "must be");
   1.174 +    return klassOop(entry.get_oop())->klass_part()->name();
   1.175    } else {
   1.176 -    assert(entry->is_symbol(), "must be either symbol or klass");
   1.177 -    return (symbolOop)entry;
   1.178 +    assert(entry.is_metadata(), "must be either symbol or klass");
   1.179 +    return entry.get_symbol();
   1.180    }
   1.181  }
   1.182  
   1.183 -symbolOop constantPoolOopDesc::klass_ref_at_noresolve(int which) {
   1.184 +Symbol* constantPoolOopDesc::klass_ref_at_noresolve(int which) {
   1.185    jint ref_index = klass_ref_index_at(which);
   1.186    return klass_at_noresolve(ref_index);
   1.187  }
   1.188  
   1.189 -symbolOop constantPoolOopDesc::uncached_klass_ref_at_noresolve(int which) {
   1.190 +Symbol* constantPoolOopDesc::uncached_klass_ref_at_noresolve(int which) {
   1.191    jint ref_index = uncached_klass_ref_index_at(which);
   1.192    return klass_at_noresolve(ref_index);
   1.193  }
   1.194  
   1.195  char* constantPoolOopDesc::string_at_noresolve(int which) {
   1.196    // Test entry type in case string is resolved while in here.
   1.197 -  oop entry = *(obj_at_addr(which));
   1.198 -  if (entry->is_symbol()) {
   1.199 -    return ((symbolOop)entry)->as_C_string();
   1.200 -  } else if (java_lang_String::is_instance(entry)) {
   1.201 -    return java_lang_String::as_utf8_string(entry);
   1.202 +  CPSlot entry = slot_at(which);
   1.203 +  if (entry.is_metadata()) {
   1.204 +    return (entry.get_symbol())->as_C_string();
   1.205 +  } else if (java_lang_String::is_instance(entry.get_oop())) {
   1.206 +    return java_lang_String::as_utf8_string(entry.get_oop());
   1.207    } else {
   1.208      return (char*)"<pseudo-string>";
   1.209    }
   1.210 @@ -498,8 +502,8 @@
   1.211      {
   1.212        int ref_kind                 = this_oop->method_handle_ref_kind_at(index);
   1.213        int callee_index             = this_oop->method_handle_klass_index_at(index);
   1.214 -      symbolHandle name(THREAD,      this_oop->method_handle_name_ref_at(index));
   1.215 -      symbolHandle signature(THREAD, this_oop->method_handle_signature_ref_at(index));
   1.216 +      Symbol*  name =      this_oop->method_handle_name_ref_at(index);
   1.217 +      Symbol*  signature = this_oop->method_handle_signature_ref_at(index);
   1.218        if (PrintMiscellaneous)
   1.219          tty->print_cr("resolve JVM_CONSTANT_MethodHandle:%d [%d/%d/%d] %s.%s",
   1.220                        ref_kind, index, this_oop->method_handle_index_at(index),
   1.221 @@ -524,7 +528,7 @@
   1.222  
   1.223    case JVM_CONSTANT_MethodType:
   1.224      {
   1.225 -      symbolHandle signature(THREAD, this_oop->method_type_signature_at(index));
   1.226 +      Symbol*  signature = this_oop->method_type_signature_at(index);
   1.227        if (PrintMiscellaneous)
   1.228          tty->print_cr("resolve JVM_CONSTANT_MethodType [%d/%d] %s",
   1.229                        index, this_oop->method_type_index_at(index),
   1.230 @@ -605,30 +609,33 @@
   1.231  }
   1.232  
   1.233  oop constantPoolOopDesc::string_at_impl(constantPoolHandle this_oop, int which, TRAPS) {
   1.234 -  oop entry = *(this_oop->obj_at_addr(which));
   1.235 -  if (entry->is_symbol()) {
   1.236 +  oop str = NULL;
   1.237 +  CPSlot entry = this_oop->slot_at(which);
   1.238 +  if (entry.is_metadata()) {
   1.239      ObjectLocker ol(this_oop, THREAD);
   1.240      if (this_oop->tag_at(which).is_unresolved_string()) {
   1.241        // Intern string
   1.242 -      symbolOop sym = this_oop->unresolved_string_at(which);
   1.243 -      entry = StringTable::intern(sym, CHECK_(constantPoolOop(NULL)));
   1.244 -      this_oop->string_at_put(which, entry);
   1.245 +      Symbol* sym = this_oop->unresolved_string_at(which);
   1.246 +      str = StringTable::intern(sym, CHECK_(constantPoolOop(NULL)));
   1.247 +      this_oop->string_at_put(which, str);
   1.248      } else {
   1.249        // Another thread beat us and interned string, read string from constant pool
   1.250 -      entry = this_oop->resolved_string_at(which);
   1.251 +      str = this_oop->resolved_string_at(which);
   1.252      }
   1.253 +  } else {
   1.254 +    str = entry.get_oop();
   1.255    }
   1.256 -  assert(java_lang_String::is_instance(entry), "must be string");
   1.257 -  return entry;
   1.258 +  assert(java_lang_String::is_instance(str), "must be string");
   1.259 +  return str;
   1.260  }
   1.261  
   1.262  
   1.263  bool constantPoolOopDesc::is_pseudo_string_at(int which) {
   1.264 -  oop entry = *(obj_at_addr(which));
   1.265 -  if (entry->is_symbol())
   1.266 +  CPSlot entry = slot_at(which);
   1.267 +  if (entry.is_metadata())
   1.268      // Not yet resolved, but it will resolve to a string.
   1.269      return false;
   1.270 -  else if (java_lang_String::is_instance(entry))
   1.271 +  else if (java_lang_String::is_instance(entry.get_oop()))
   1.272      return false; // actually, it might be a non-interned or non-perm string
   1.273    else
   1.274      // truly pseudo
   1.275 @@ -638,8 +645,8 @@
   1.276  
   1.277  bool constantPoolOopDesc::klass_name_at_matches(instanceKlassHandle k,
   1.278                                                  int which) {
   1.279 -  // Names are interned, so we can compare symbolOops directly
   1.280 -  symbolOop cp_name = klass_name_at(which);
   1.281 +  // Names are interned, so we can compare Symbol*s directly
   1.282 +  Symbol* cp_name = klass_name_at(which);
   1.283    return (cp_name == k->name());
   1.284  }
   1.285  
   1.286 @@ -650,7 +657,7 @@
   1.287    for (int index = 1; index < tags()->length(); index++) { // Index 0 is unused
   1.288      if (tag_at(index).is_unresolved_string()) {
   1.289        // Intern string
   1.290 -      symbolOop sym = unresolved_string_at(index);
   1.291 +      Symbol* sym = unresolved_string_at(index);
   1.292        oop entry = StringTable::intern(sym, CHECK_(-1));
   1.293        string_at_put(index, entry);
   1.294      }
   1.295 @@ -658,23 +665,39 @@
   1.296    return count;
   1.297  }
   1.298  
   1.299 +// Iterate over symbols and decrement ones which are Symbol*s.
   1.300 +// This is done during GC so do not need to lock constantPool unless we
   1.301 +// have per-thread safepoints.
   1.302 +// Only decrement the UTF8 symbols. Unresolved classes and strings point to
   1.303 +// these symbols but didn't increment the reference count.
   1.304 +void constantPoolOopDesc::unreference_symbols() {
   1.305 +  for (int index = 1; index < length(); index++) { // Index 0 is unused
   1.306 +    constantTag tag = tag_at(index);
   1.307 +    if (tag.is_symbol()) {
   1.308 +      symbol_at(index)->decrement_refcount();
   1.309 +    }
   1.310 +  }
   1.311 +}
   1.312  
   1.313  // Iterate over symbols which are used as class, field, method names and
   1.314  // signatures (in preparation for writing to the shared archive).
   1.315  
   1.316 -void constantPoolOopDesc::shared_symbols_iterate(OopClosure* closure) {
   1.317 +void constantPoolOopDesc::shared_symbols_iterate(SymbolClosure* closure) {
   1.318    for (int index = 1; index < length(); index++) { // Index 0 is unused
   1.319      switch (tag_at(index).value()) {
   1.320  
   1.321      case JVM_CONSTANT_UnresolvedClass:
   1.322 -      closure->do_oop(obj_at_addr(index));
   1.323 +    case JVM_CONSTANT_UnresolvedString:
   1.324 +    case JVM_CONSTANT_Utf8:
   1.325 +      assert(slot_at(index).is_metadata(), "must be symbol");
   1.326 +      closure->do_symbol(symbol_at_addr(index));
   1.327        break;
   1.328  
   1.329      case JVM_CONSTANT_NameAndType:
   1.330        {
   1.331          int i = *int_at_addr(index);
   1.332 -        closure->do_oop(obj_at_addr((unsigned)i >> 16));
   1.333 -        closure->do_oop(obj_at_addr((unsigned)i & 0xffff));
   1.334 +        closure->do_symbol(symbol_at_addr((unsigned)i >> 16));
   1.335 +        closure->do_symbol(symbol_at_addr((unsigned)i & 0xffff));
   1.336        }
   1.337        break;
   1.338  
   1.339 @@ -692,12 +715,6 @@
   1.340        // Do nothing!  Not a symbol.
   1.341        break;
   1.342  
   1.343 -    case JVM_CONSTANT_UnresolvedString:
   1.344 -    case JVM_CONSTANT_Utf8:
   1.345 -      // These constants are symbols, but unless these symbols are
   1.346 -      // actually to be used for something, we don't want to mark them.
   1.347 -      break;
   1.348 -
   1.349      case JVM_CONSTANT_Long:
   1.350      case JVM_CONSTANT_Double:
   1.351        // Do nothing!  Not an oop. (But takes two pool entries.)
   1.352 @@ -744,7 +761,7 @@
   1.353        break;
   1.354  
   1.355      case JVM_CONSTANT_String:
   1.356 -      closure->do_oop(obj_at_addr(index));
   1.357 +      closure->do_oop(obj_at_addr_raw(index));
   1.358        break;
   1.359  
   1.360      case JVM_CONSTANT_UnresolvedString:
   1.361 @@ -904,8 +921,8 @@
   1.362  
   1.363    case JVM_CONSTANT_UnresolvedClass:
   1.364    {
   1.365 -    symbolOop k1 = unresolved_klass_at(index1);
   1.366 -    symbolOop k2 = cp2->unresolved_klass_at(index2);
   1.367 +    Symbol* k1 = unresolved_klass_at(index1);
   1.368 +    Symbol* k2 = cp2->unresolved_klass_at(index2);
   1.369      if (k1 == k2) {
   1.370        return true;
   1.371      }
   1.372 @@ -960,8 +977,8 @@
   1.373  
   1.374    case JVM_CONSTANT_UnresolvedString:
   1.375    {
   1.376 -    symbolOop s1 = unresolved_string_at(index1);
   1.377 -    symbolOop s2 = cp2->unresolved_string_at(index2);
   1.378 +    Symbol* s1 = unresolved_string_at(index1);
   1.379 +    Symbol* s2 = cp2->unresolved_string_at(index2);
   1.380      if (s1 == s2) {
   1.381        return true;
   1.382      }
   1.383 @@ -969,8 +986,8 @@
   1.384  
   1.385    case JVM_CONSTANT_Utf8:
   1.386    {
   1.387 -    symbolOop s1 = symbol_at(index1);
   1.388 -    symbolOop s2 = cp2->symbol_at(index2);
   1.389 +    Symbol* s1 = symbol_at(index1);
   1.390 +    Symbol* s2 = cp2->symbol_at(index2);
   1.391      if (s1 == s2) {
   1.392        return true;
   1.393      }
   1.394 @@ -1158,13 +1175,13 @@
   1.395  
   1.396    case JVM_CONSTANT_UnresolvedClass:
   1.397    {
   1.398 -    symbolOop k = from_cp->unresolved_klass_at(from_i);
   1.399 +    Symbol* k = from_cp->unresolved_klass_at(from_i);
   1.400      to_cp->unresolved_klass_at_put(to_i, k);
   1.401    } break;
   1.402  
   1.403    case JVM_CONSTANT_UnresolvedClassInError:
   1.404    {
   1.405 -    symbolOop k = from_cp->unresolved_klass_at(from_i);
   1.406 +    Symbol* k = from_cp->unresolved_klass_at(from_i);
   1.407      to_cp->unresolved_klass_at_put(to_i, k);
   1.408      to_cp->tag_at_put(to_i, JVM_CONSTANT_UnresolvedClassInError);
   1.409    } break;
   1.410 @@ -1172,14 +1189,16 @@
   1.411  
   1.412    case JVM_CONSTANT_UnresolvedString:
   1.413    {
   1.414 -    symbolOop s = from_cp->unresolved_string_at(from_i);
   1.415 +    Symbol* s = from_cp->unresolved_string_at(from_i);
   1.416      to_cp->unresolved_string_at_put(to_i, s);
   1.417    } break;
   1.418  
   1.419    case JVM_CONSTANT_Utf8:
   1.420    {
   1.421 -    symbolOop s = from_cp->symbol_at(from_i);
   1.422 +    Symbol* s = from_cp->symbol_at(from_i);
   1.423      to_cp->symbol_at_put(to_i, s);
   1.424 +    // This constantPool has the same lifetime as the original, so don't
   1.425 +    // increase reference counts for the copy.
   1.426    } break;
   1.427  
   1.428    case JVM_CONSTANT_MethodType:
   1.429 @@ -1453,7 +1472,7 @@
   1.430  
   1.431      switch(tag) {
   1.432        case JVM_CONSTANT_Utf8: {
   1.433 -        symbolOop sym = symbol_at(idx);
   1.434 +        Symbol* sym = symbol_at(idx);
   1.435          symmap->add_entry(sym, idx);
   1.436          DBG(printf("adding symbol entry %s = %d\n", sym->as_utf8(), idx));
   1.437          break;
   1.438 @@ -1461,7 +1480,7 @@
   1.439        case JVM_CONSTANT_Class:
   1.440        case JVM_CONSTANT_UnresolvedClass:
   1.441        case JVM_CONSTANT_UnresolvedClassInError: {
   1.442 -        symbolOop sym = klass_name_at(idx);
   1.443 +        Symbol* sym = klass_name_at(idx);
   1.444          classmap->add_entry(sym, idx);
   1.445          DBG(printf("adding class entry %s = %d\n", sym->as_utf8(), idx));
   1.446          break;
   1.447 @@ -1509,7 +1528,7 @@
   1.448          break;
   1.449        }
   1.450        case JVM_CONSTANT_Utf8: {
   1.451 -        symbolOop sym = symbol_at(idx);
   1.452 +        Symbol* sym = symbol_at(idx);
   1.453          char*     str = sym->as_utf8();
   1.454          // Warning! It's crashing on x86 with len = sym->utf8_length()
   1.455          int       len = (int) strlen(str);
   1.456 @@ -1546,7 +1565,7 @@
   1.457        case JVM_CONSTANT_UnresolvedClass:
   1.458        case JVM_CONSTANT_UnresolvedClassInError: {
   1.459          *bytes = JVM_CONSTANT_Class;
   1.460 -        symbolOop sym = klass_name_at(idx);
   1.461 +        Symbol* sym = klass_name_at(idx);
   1.462          idx1 = tbl->symbol_to_value(sym);
   1.463          assert(idx1 != 0, "Have not found a hashtable entry");
   1.464          Bytes::put_Java_u2((address) (bytes+1), idx1);
   1.465 @@ -1556,19 +1575,19 @@
   1.466        case JVM_CONSTANT_String: {
   1.467          unsigned int hash;
   1.468          char *str = string_at_noresolve(idx);
   1.469 -        symbolOop sym = SymbolTable::lookup_only(str, (int) strlen(str), hash);
   1.470 +        TempNewSymbol sym = SymbolTable::lookup_only(str, (int) strlen(str), hash);
   1.471          if (sym == NULL) {
   1.472            // sym can be NULL if string refers to incorrectly encoded JVM_CONSTANT_Utf8
   1.473            // this can happen with JVM TI; see CR 6839599 for more details
   1.474 -          oop string = *(obj_at_addr(idx));
   1.475 +          oop string = *(obj_at_addr_raw(idx));
   1.476            assert(java_lang_String::is_instance(string),"Not a String");
   1.477            DBG(printf("Error #%03hd tag=%03hd\n", idx, tag));
   1.478            idx1 = 0;
   1.479            for (int j = 0; j < tbl->table_size() && idx1 == 0; j++) {
   1.480              for (SymbolHashMapEntry* cur = tbl->bucket(j); cur != NULL; cur = cur->next()) {
   1.481                int length;
   1.482 -              sym = cur->symbol();
   1.483 -              jchar* chars = sym->as_unicode(length);
   1.484 +              Symbol* s = cur->symbol();
   1.485 +              jchar* chars = s->as_unicode(length);
   1.486                if (java_lang_String::equals(string, chars, length)) {
   1.487                  idx1 = cur->value();
   1.488                  DBG(printf("Index found: %d\n",idx1));
   1.489 @@ -1586,7 +1605,7 @@
   1.490        }
   1.491        case JVM_CONSTANT_UnresolvedString: {
   1.492          *bytes = JVM_CONSTANT_String;
   1.493 -        symbolOop sym = unresolved_string_at(idx);
   1.494 +        Symbol* sym = unresolved_string_at(idx);
   1.495          idx1 = tbl->symbol_to_value(sym);
   1.496          assert(idx1 != 0, "Have not found a hashtable entry");
   1.497          Bytes::put_Java_u2((address) (bytes+1), idx1);
   1.498 @@ -1666,7 +1685,7 @@
   1.499  } /* end copy_cpool_bytes */
   1.500  
   1.501  
   1.502 -void SymbolHashMap::add_entry(symbolOop sym, u2 value) {
   1.503 +void SymbolHashMap::add_entry(Symbol* sym, u2 value) {
   1.504    char *str = sym->as_utf8();
   1.505    unsigned int hash = compute_hash(str, sym->utf8_length());
   1.506    unsigned int index = hash % table_size();
   1.507 @@ -1687,7 +1706,7 @@
   1.508    assert(entry->symbol() != NULL, "SymbolHashMapEntry symbol is NULL");
   1.509  }
   1.510  
   1.511 -SymbolHashMapEntry* SymbolHashMap::find_entry(symbolOop sym) {
   1.512 +SymbolHashMapEntry* SymbolHashMap::find_entry(Symbol* sym) {
   1.513    assert(sym != NULL, "SymbolHashMap::find_entry - symbol is NULL");
   1.514    char *str = sym->as_utf8();
   1.515    int   len = sym->utf8_length();

mercurial