< prev index next >

src/hotspot/share/classfile/systemDictionary.hpp

Print this page
rev 48545 : Value-based classes (vbc) / Oop value test via metadata ptr
   1 /*
   2  * Copyright (c) 1997, 2017, 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  *


 447     assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
 448     return &_well_known_klasses[id];
 449   }
 450   static void well_known_klasses_do(MetaspaceClosure* it);
 451 
 452   // Local definition for direct access to the private array:
 453   #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]
 454 
 455   static InstanceKlass* box_klass(BasicType t) {
 456     assert((uint)t < T_VOID+1, "range check");
 457     return check_klass(_box_klasses[t]);
 458   }
 459   static BasicType box_klass_type(Klass* k);  // inverse of box_klass
 460 
 461   // methods returning lazily loaded klasses
 462   // The corresponding method to load the class must be called before calling them.
 463   static InstanceKlass* abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); }
 464 
 465   static void load_abstract_ownable_synchronizer_klass(TRAPS);
 466 







 467 protected:
 468   // Tells whether ClassLoader.loadClassInternal is present
 469   static bool has_loadClassInternal()       { return _has_loadClassInternal; }
 470 
 471   // Returns the class loader data to be used when looking up/updating the
 472   // system dictionary.
 473   static ClassLoaderData *class_loader_data(Handle class_loader) {
 474     return ClassLoaderData::class_loader_data(class_loader());
 475   }
 476 
 477 public:
 478   // Tells whether ClassLoader.checkPackageAccess is present
 479   static bool has_checkPackageAccess()      { return _has_checkPackageAccess; }
 480 
 481   static bool Parameter_klass_loaded()      { return WK_KLASS(reflect_Parameter_klass) != NULL; }
 482   static bool Class_klass_loaded()          { return WK_KLASS(Class_klass) != NULL; }
 483   static bool Cloneable_klass_loaded()      { return WK_KLASS(Cloneable_klass) != NULL; }
 484   static bool Object_klass_loaded()         { return WK_KLASS(Object_klass) != NULL; }
 485   static bool ClassLoader_klass_loaded()    { return WK_KLASS(ClassLoader_klass) != NULL; }
 486 


 687                                 bool defining, TRAPS);
 688   static void update_dictionary(unsigned int d_hash,
 689                                 int p_index, unsigned int p_hash,
 690                                 InstanceKlass* k, Handle loader,
 691                                 TRAPS);
 692 
 693   // Variables holding commonly used klasses (preloaded)
 694   static InstanceKlass* _well_known_klasses[];
 695 
 696   // Lazily loaded klasses
 697   static InstanceKlass* volatile _abstract_ownable_synchronizer_klass;
 698 
 699   // table of box klasses (int_klass, etc.)
 700   static InstanceKlass* _box_klasses[T_VOID+1];
 701 
 702   static oop  _java_system_loader;
 703   static oop  _java_platform_loader;
 704 
 705   static bool _has_loadClassInternal;
 706   static bool _has_checkPackageAccess;




 707 };
 708 
 709 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP
   1 /*
   2  * Copyright (c) 1997, 2018, 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  *


 447     assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
 448     return &_well_known_klasses[id];
 449   }
 450   static void well_known_klasses_do(MetaspaceClosure* it);
 451 
 452   // Local definition for direct access to the private array:
 453   #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]
 454 
 455   static InstanceKlass* box_klass(BasicType t) {
 456     assert((uint)t < T_VOID+1, "range check");
 457     return check_klass(_box_klasses[t]);
 458   }
 459   static BasicType box_klass_type(Klass* k);  // inverse of box_klass
 460 
 461   // methods returning lazily loaded klasses
 462   // The corresponding method to load the class must be called before calling them.
 463   static InstanceKlass* abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); }
 464 
 465   static void load_abstract_ownable_synchronizer_klass(TRAPS);
 466 
 467 #if INCLUDE_VBC
 468   static bool is_value_based_classname(Symbol* name) {
 469     if (_value_based_classes == NULL) return false;
 470     return _value_based_classes->find(name) >= 0;
 471   }
 472 #endif
 473 
 474 protected:
 475   // Tells whether ClassLoader.loadClassInternal is present
 476   static bool has_loadClassInternal()       { return _has_loadClassInternal; }
 477 
 478   // Returns the class loader data to be used when looking up/updating the
 479   // system dictionary.
 480   static ClassLoaderData *class_loader_data(Handle class_loader) {
 481     return ClassLoaderData::class_loader_data(class_loader());
 482   }
 483 
 484 public:
 485   // Tells whether ClassLoader.checkPackageAccess is present
 486   static bool has_checkPackageAccess()      { return _has_checkPackageAccess; }
 487 
 488   static bool Parameter_klass_loaded()      { return WK_KLASS(reflect_Parameter_klass) != NULL; }
 489   static bool Class_klass_loaded()          { return WK_KLASS(Class_klass) != NULL; }
 490   static bool Cloneable_klass_loaded()      { return WK_KLASS(Cloneable_klass) != NULL; }
 491   static bool Object_klass_loaded()         { return WK_KLASS(Object_klass) != NULL; }
 492   static bool ClassLoader_klass_loaded()    { return WK_KLASS(ClassLoader_klass) != NULL; }
 493 


 694                                 bool defining, TRAPS);
 695   static void update_dictionary(unsigned int d_hash,
 696                                 int p_index, unsigned int p_hash,
 697                                 InstanceKlass* k, Handle loader,
 698                                 TRAPS);
 699 
 700   // Variables holding commonly used klasses (preloaded)
 701   static InstanceKlass* _well_known_klasses[];
 702 
 703   // Lazily loaded klasses
 704   static InstanceKlass* volatile _abstract_ownable_synchronizer_klass;
 705 
 706   // table of box klasses (int_klass, etc.)
 707   static InstanceKlass* _box_klasses[T_VOID+1];
 708 
 709   static oop  _java_system_loader;
 710   static oop  _java_platform_loader;
 711 
 712   static bool _has_loadClassInternal;
 713   static bool _has_checkPackageAccess;
 714 #if INCLUDE_VBC
 715   // List of value-based classes
 716   static GrowableArray<Symbol*>* _value_based_classes;
 717 #endif
 718 };
 719 
 720 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP
< prev index next >