src/share/vm/oops/cpCacheOop.hpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 281   void oop_iterate(OopClosure* blk);
 282   void oop_iterate_m(OopClosure* blk, MemRegion mr);
 283   void follow_contents();
 284   void adjust_pointers();
 285 
 286 #ifndef SERIALGC
 287   // Parallel Old
 288   void follow_contents(ParCompactionManager* cm);
 289 #endif // SERIALGC
 290 
 291   void update_pointers();
 292 
 293   // RedefineClasses() API support:
 294   // If this constantPoolCacheEntry refers to old_method then update it
 295   // to refer to new_method.
 296   // trace_name_printed is set to true if the current call has
 297   // printed the klass name so that other routines in the adjust_*
 298   // group don't print the klass name.
 299   bool adjust_method_entry(methodOop old_method, methodOop new_method,
 300          bool * trace_name_printed);

 301   bool is_interesting_method_entry(klassOop k);
 302   bool is_field_entry() const                    { return (_flags & (1 << hotSwapBit)) == 0; }
 303   bool is_method_entry() const                   { return (_flags & (1 << hotSwapBit)) != 0; }
 304 
 305   // Debugging & Printing
 306   void print (outputStream* st, int index) const;
 307   void verify(outputStream* st) const;
 308 
 309   static void verify_tosBits() {
 310     assert(tosBits == 28, "interpreter now assumes tosBits is 28");
 311   }
 312 };
 313 
 314 
 315 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache
 316 // holds interpreter runtime information for all field access and invoke bytecodes. The cache
 317 // is created and initialized before a class is actively used (i.e., initialized), the indivi-
 318 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*).
 319 
 320 class constantPoolCacheOopDesc: public oopDesc {


 388     return entry_at(primary_index);
 389   }
 390 
 391   // Code generation
 392   static ByteSize base_offset()                  { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
 393   static ByteSize entry_offset(int raw_index) {
 394     int index = raw_index;
 395     if (is_secondary_index(raw_index))
 396       index = decode_secondary_index(raw_index);
 397     return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
 398   }
 399 
 400   // RedefineClasses() API support:
 401   // If any entry of this constantPoolCache points to any of
 402   // old_methods, replace it with the corresponding new_method.
 403   // trace_name_printed is set to true if the current call has
 404   // printed the klass name so that other routines in the adjust_*
 405   // group don't print the klass name.
 406   void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
 407                              int methods_length, bool * trace_name_printed);


 408 };
 409 
 410 #endif // SHARE_VM_OOPS_CPCACHEOOP_HPP
   1 /*
   2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 281   void oop_iterate(OopClosure* blk);
 282   void oop_iterate_m(OopClosure* blk, MemRegion mr);
 283   void follow_contents();
 284   void adjust_pointers();
 285 
 286 #ifndef SERIALGC
 287   // Parallel Old
 288   void follow_contents(ParCompactionManager* cm);
 289 #endif // SERIALGC
 290 
 291   void update_pointers();
 292 
 293   // RedefineClasses() API support:
 294   // If this constantPoolCacheEntry refers to old_method then update it
 295   // to refer to new_method.
 296   // trace_name_printed is set to true if the current call has
 297   // printed the klass name so that other routines in the adjust_*
 298   // group don't print the klass name.
 299   bool adjust_method_entry(methodOop old_method, methodOop new_method,
 300          bool * trace_name_printed);
 301   bool check_no_old_or_obsolete_entries();
 302   bool is_interesting_method_entry(klassOop k);
 303   bool is_field_entry() const                    { return (_flags & (1 << hotSwapBit)) == 0; }
 304   bool is_method_entry() const                   { return (_flags & (1 << hotSwapBit)) != 0; }
 305 
 306   // Debugging & Printing
 307   void print (outputStream* st, int index) const;
 308   void verify(outputStream* st) const;
 309 
 310   static void verify_tosBits() {
 311     assert(tosBits == 28, "interpreter now assumes tosBits is 28");
 312   }
 313 };
 314 
 315 
 316 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache
 317 // holds interpreter runtime information for all field access and invoke bytecodes. The cache
 318 // is created and initialized before a class is actively used (i.e., initialized), the indivi-
 319 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*).
 320 
 321 class constantPoolCacheOopDesc: public oopDesc {


 389     return entry_at(primary_index);
 390   }
 391 
 392   // Code generation
 393   static ByteSize base_offset()                  { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
 394   static ByteSize entry_offset(int raw_index) {
 395     int index = raw_index;
 396     if (is_secondary_index(raw_index))
 397       index = decode_secondary_index(raw_index);
 398     return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
 399   }
 400 
 401   // RedefineClasses() API support:
 402   // If any entry of this constantPoolCache points to any of
 403   // old_methods, replace it with the corresponding new_method.
 404   // trace_name_printed is set to true if the current call has
 405   // printed the klass name so that other routines in the adjust_*
 406   // group don't print the klass name.
 407   void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
 408                              int methods_length, bool * trace_name_printed);
 409   bool check_no_old_or_obsolete_entries();
 410   void dump_cache();
 411 };
 412 
 413 #endif // SHARE_VM_OOPS_CPCACHEOOP_HPP