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  *


 346   void oop_iterate(OopClosure* blk);
 347   void oop_iterate_m(OopClosure* blk, MemRegion mr);
 348   void follow_contents();
 349   void adjust_pointers();
 350 
 351 #ifndef SERIALGC
 352   // Parallel Old
 353   void follow_contents(ParCompactionManager* cm);
 354 #endif // SERIALGC
 355 
 356   void update_pointers();
 357 
 358   // RedefineClasses() API support:
 359   // If this constantPoolCacheEntry refers to old_method then update it
 360   // to refer to new_method.
 361   // trace_name_printed is set to true if the current call has
 362   // printed the klass name so that other routines in the adjust_*
 363   // group don't print the klass name.
 364   bool adjust_method_entry(methodOop old_method, methodOop new_method,
 365          bool * trace_name_printed);

 366   bool is_interesting_method_entry(klassOop k);
 367 
 368   // Debugging & Printing
 369   void print (outputStream* st, int index) const;
 370   void verify(outputStream* st) const;
 371 
 372   static void verify_tos_state_shift() {
 373     // When shifting flags as a 32-bit int, make sure we don't need an extra mask for tos_state:
 374     assert((((u4)-1 >> tos_state_shift) & ~tos_state_mask) == 0, "no need for tos_state mask");
 375   }
 376 };
 377 
 378 
 379 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache
 380 // holds interpreter runtime information for all field access and invoke bytecodes. The cache
 381 // is created and initialized before a class is actively used (i.e., initialized), the indivi-
 382 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*).
 383 
 384 class constantPoolCacheOopDesc: public oopDesc {
 385   friend class VMStructs;


 475     return NULL;
 476   }
 477 
 478   // Code generation
 479   static ByteSize base_offset()                  { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
 480   static ByteSize entry_offset(int raw_index) {
 481     int index = raw_index;
 482     if (is_secondary_index(raw_index))
 483       index = decode_secondary_index(raw_index);
 484     return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
 485   }
 486 
 487   // RedefineClasses() API support:
 488   // If any entry of this constantPoolCache points to any of
 489   // old_methods, replace it with the corresponding new_method.
 490   // trace_name_printed is set to true if the current call has
 491   // printed the klass name so that other routines in the adjust_*
 492   // group don't print the klass name.
 493   void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
 494                              int methods_length, bool * trace_name_printed);


 495 };
 496 
 497 #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  *


 346   void oop_iterate(OopClosure* blk);
 347   void oop_iterate_m(OopClosure* blk, MemRegion mr);
 348   void follow_contents();
 349   void adjust_pointers();
 350 
 351 #ifndef SERIALGC
 352   // Parallel Old
 353   void follow_contents(ParCompactionManager* cm);
 354 #endif // SERIALGC
 355 
 356   void update_pointers();
 357 
 358   // RedefineClasses() API support:
 359   // If this constantPoolCacheEntry refers to old_method then update it
 360   // to refer to new_method.
 361   // trace_name_printed is set to true if the current call has
 362   // printed the klass name so that other routines in the adjust_*
 363   // group don't print the klass name.
 364   bool adjust_method_entry(methodOop old_method, methodOop new_method,
 365          bool * trace_name_printed);
 366   bool check_no_old_or_obsolete_entries();
 367   bool is_interesting_method_entry(klassOop k);
 368 
 369   // Debugging & Printing
 370   void print (outputStream* st, int index) const;
 371   void verify(outputStream* st) const;
 372 
 373   static void verify_tos_state_shift() {
 374     // When shifting flags as a 32-bit int, make sure we don't need an extra mask for tos_state:
 375     assert((((u4)-1 >> tos_state_shift) & ~tos_state_mask) == 0, "no need for tos_state mask");
 376   }
 377 };
 378 
 379 
 380 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache
 381 // holds interpreter runtime information for all field access and invoke bytecodes. The cache
 382 // is created and initialized before a class is actively used (i.e., initialized), the indivi-
 383 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*).
 384 
 385 class constantPoolCacheOopDesc: public oopDesc {
 386   friend class VMStructs;


 476     return NULL;
 477   }
 478 
 479   // Code generation
 480   static ByteSize base_offset()                  { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
 481   static ByteSize entry_offset(int raw_index) {
 482     int index = raw_index;
 483     if (is_secondary_index(raw_index))
 484       index = decode_secondary_index(raw_index);
 485     return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
 486   }
 487 
 488   // RedefineClasses() API support:
 489   // If any entry of this constantPoolCache points to any of
 490   // old_methods, replace it with the corresponding new_method.
 491   // trace_name_printed is set to true if the current call has
 492   // printed the klass name so that other routines in the adjust_*
 493   // group don't print the klass name.
 494   void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
 495                              int methods_length, bool * trace_name_printed);
 496   bool check_no_old_or_obsolete_entries();
 497   void dump_cache();
 498 };
 499 
 500 #endif // SHARE_VM_OOPS_CPCACHEOOP_HPP