Sat, 21 Sep 2013 01:45:29 +0200
Merge
1.1 --- a/src/share/vm/oops/constantPool.cpp Fri Sep 20 10:34:41 2013 -0700 1.2 +++ b/src/share/vm/oops/constantPool.cpp Sat Sep 21 01:45:29 2013 +0200 1.3 @@ -108,16 +108,16 @@ 1.4 void ConstantPool::initialize_resolved_references(ClassLoaderData* loader_data, 1.5 intStack reference_map, 1.6 int constant_pool_map_length, 1.7 - TRAPS) { 1.8 + TRAPS) { 1.9 // Initialized the resolved object cache. 1.10 int map_length = reference_map.length(); 1.11 if (map_length > 0) { 1.12 // Only need mapping back to constant pool entries. The map isn't used for 1.13 - // invokedynamic resolved_reference entries. The constant pool cache index 1.14 - // has the mapping back to both the constant pool and to the resolved 1.15 - // reference index. 1.16 + // invokedynamic resolved_reference entries. For invokedynamic entries, 1.17 + // the constant pool cache index has the mapping back to both the constant 1.18 + // pool and to the resolved reference index. 1.19 if (constant_pool_map_length > 0) { 1.20 - Array<u2>* om = MetadataFactory::new_array<u2>(loader_data, map_length, CHECK); 1.21 + Array<u2>* om = MetadataFactory::new_array<u2>(loader_data, constant_pool_map_length, CHECK); 1.22 1.23 for (int i = 0; i < constant_pool_map_length; i++) { 1.24 int x = reference_map.at(i); 1.25 @@ -182,16 +182,9 @@ 1.26 1.27 int ConstantPool::cp_to_object_index(int cp_index) { 1.28 // this is harder don't do this so much. 1.29 - for (int i = 0; i< reference_map()->length(); i++) { 1.30 - if (reference_map()->at(i) == cp_index) return i; 1.31 - // Zero entry is divider between constant pool indices for strings, 1.32 - // method handles and method types. After that the index is a constant 1.33 - // pool cache index for invokedynamic. Stop when zero (which can never 1.34 - // be a constant pool index) 1.35 - if (reference_map()->at(i) == 0) break; 1.36 - } 1.37 - // We might not find the index. 1.38 - return _no_index_sentinel; 1.39 + int i = reference_map()->find(cp_index); 1.40 + // We might not find the index for jsr292 call. 1.41 + return (i < 0) ? _no_index_sentinel : i; 1.42 } 1.43 1.44 Klass* ConstantPool::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS) { 1.45 @@ -866,8 +859,7 @@ 1.46 // If the string has already been interned, this entry will be non-null 1.47 oop str = this_oop->resolved_references()->obj_at(obj_index); 1.48 if (str != NULL) return str; 1.49 - 1.50 - Symbol* sym = this_oop->unresolved_string_at(which); 1.51 + Symbol* sym = this_oop->unresolved_string_at(which); 1.52 str = StringTable::intern(sym, CHECK_(NULL)); 1.53 this_oop->string_at_put(which, obj_index, str); 1.54 assert(java_lang_String::is_instance(str), "must be string");
2.1 --- a/src/share/vm/oops/constantPool.hpp Fri Sep 20 10:34:41 2013 -0700 2.2 +++ b/src/share/vm/oops/constantPool.hpp Sat Sep 21 01:45:29 2013 +0200 2.3 @@ -231,7 +231,6 @@ 2.4 static int cache_offset_in_bytes() { return offset_of(ConstantPool, _cache); } 2.5 static int pool_holder_offset_in_bytes() { return offset_of(ConstantPool, _pool_holder); } 2.6 static int resolved_references_offset_in_bytes() { return offset_of(ConstantPool, _resolved_references); } 2.7 - static int reference_map_offset_in_bytes() { return offset_of(ConstantPool, _reference_map); } 2.8 2.9 // Storing constants 2.10