hotspot/src/share/vm/oops/constantPool.hpp
changeset 31046 d01ad7a0ecb0
parent 31038 2fd2fdc6a70a
child 33160 c59f1676d27e
equal deleted inserted replaced
31045:31769e6e8293 31046:d01ad7a0ecb0
    82   InstanceKlass*       _pool_holder; // the corresponding class
    82   InstanceKlass*       _pool_holder; // the corresponding class
    83   Array<u2>*           _operands;    // for variable-sized (InvokeDynamic) nodes, usually empty
    83   Array<u2>*           _operands;    // for variable-sized (InvokeDynamic) nodes, usually empty
    84 
    84 
    85   // Array of resolved objects from the constant pool and map from resolved
    85   // Array of resolved objects from the constant pool and map from resolved
    86   // object index to original constant pool index
    86   // object index to original constant pool index
       
    87   jobject              _resolved_references;
    87   Array<u2>*           _reference_map;
    88   Array<u2>*           _reference_map;
    88 
    89 
    89   enum {
    90   enum {
    90     _has_preresolution = 1,           // Flags
    91     _has_preresolution = 1,           // Flags
    91     _on_stack          = 2
    92     _on_stack          = 2
   188                                       int constant_pool_map_length,
   189                                       int constant_pool_map_length,
   189                                       TRAPS);
   190                                       TRAPS);
   190 
   191 
   191   // resolved strings, methodHandles and callsite objects from the constant pool
   192   // resolved strings, methodHandles and callsite objects from the constant pool
   192   objArrayOop resolved_references()  const;
   193   objArrayOop resolved_references()  const;
   193 
       
   194   // mapping resolved object array indexes to cp indexes and back.
   194   // mapping resolved object array indexes to cp indexes and back.
   195   int object_to_cp_index(int index)         { return _reference_map->at(index); }
   195   int object_to_cp_index(int index)         { return _reference_map->at(index); }
   196   int cp_to_object_index(int index);
   196   int cp_to_object_index(int index);
   197 
   197 
   198   // Invokedynamic indexes.
   198   // Invokedynamic indexes.
   220 
   220 
   221   // Assembly code support
   221   // Assembly code support
   222   static int tags_offset_in_bytes()         { return offset_of(ConstantPool, _tags); }
   222   static int tags_offset_in_bytes()         { return offset_of(ConstantPool, _tags); }
   223   static int cache_offset_in_bytes()        { return offset_of(ConstantPool, _cache); }
   223   static int cache_offset_in_bytes()        { return offset_of(ConstantPool, _cache); }
   224   static int pool_holder_offset_in_bytes()  { return offset_of(ConstantPool, _pool_holder); }
   224   static int pool_holder_offset_in_bytes()  { return offset_of(ConstantPool, _pool_holder); }
       
   225   static int resolved_references_offset_in_bytes() { return offset_of(ConstantPool, _resolved_references); }
   225 
   226 
   226   // Storing constants
   227   // Storing constants
   227 
   228 
   228   void klass_at_put(int which, Klass* k) {
   229   void klass_at_put(int which, Klass* k) {
   229     assert(k != NULL, "resolved class shouldn't be null");
   230     assert(k != NULL, "resolved class shouldn't be null");
   768       return raw_index - CPCACHE_INDEX_TAG;
   769       return raw_index - CPCACHE_INDEX_TAG;
   769   }
   770   }
   770 
   771 
   771  private:
   772  private:
   772 
   773 
       
   774   void set_resolved_references(jobject s) { _resolved_references = s; }
   773   Array<u2>* reference_map() const        { return _reference_map; }
   775   Array<u2>* reference_map() const        { return _reference_map; }
   774   void set_reference_map(Array<u2>* o)    { _reference_map = o; }
   776   void set_reference_map(Array<u2>* o)    { _reference_map = o; }
   775 
   777 
   776   // patch JSR 292 resolved references after the class is linked.
   778   // patch JSR 292 resolved references after the class is linked.
   777   void patch_resolved_references(GrowableArray<Handle>* cp_patches);
   779   void patch_resolved_references(GrowableArray<Handle>* cp_patches);