src/hotspot/share/classfile/dictionary.cpp
changeset 47761 1b0566927c7a
parent 47216 71c04702a3d5
child 47774 69c081ca110a
equal deleted inserted replaced
47760:c15f15bcc23e 47761:1b0566927c7a
   355                                             Handle protection_domain) {
   355                                             Handle protection_domain) {
   356   DictionaryEntry* entry = get_entry(index, hash, name);
   356   DictionaryEntry* entry = get_entry(index, hash, name);
   357   return entry->is_valid_protection_domain(protection_domain);
   357   return entry->is_valid_protection_domain(protection_domain);
   358 }
   358 }
   359 
   359 
       
   360 #if INCLUDE_CDS
       
   361 static bool is_jfr_event_class(Klass *k) {
       
   362   while (k) {
       
   363     if (k->name()->equals("jdk/jfr/Event")) {
       
   364       return true;
       
   365     }
       
   366     k = k->super();
       
   367   }
       
   368   return false;
       
   369 }
   360 
   370 
   361 void Dictionary::reorder_dictionary_for_sharing() {
   371 void Dictionary::reorder_dictionary_for_sharing() {
   362 
   372 
   363   // Copy all the dictionary entries into a single master list.
   373   // Copy all the dictionary entries into a single master list.
   364 
   374 
   366   for (int i = 0; i < table_size(); ++i) {
   376   for (int i = 0; i < table_size(); ++i) {
   367     DictionaryEntry* p = bucket(i);
   377     DictionaryEntry* p = bucket(i);
   368     while (p != NULL) {
   378     while (p != NULL) {
   369       DictionaryEntry* next = p->next();
   379       DictionaryEntry* next = p->next();
   370       InstanceKlass*ik = p->instance_klass();
   380       InstanceKlass*ik = p->instance_klass();
   371       // we cannot include signed classes in the archive because the certificates
       
   372       // used during dump time may be different than those used during
       
   373       // runtime (due to expiration, etc).
       
   374       if (ik->signers() != NULL) {
   381       if (ik->signers() != NULL) {
       
   382         // We cannot include signed classes in the archive because the certificates
       
   383         // used during dump time may be different than those used during
       
   384         // runtime (due to expiration, etc).
   375         ResourceMark rm;
   385         ResourceMark rm;
   376         tty->print_cr("Preload Warning: Skipping %s from signed JAR",
   386         tty->print_cr("Preload Warning: Skipping %s from signed JAR",
   377                        ik->name()->as_C_string());
   387                        ik->name()->as_C_string());
       
   388         free_entry(p);
       
   389       } else if (is_jfr_event_class(ik)) {
       
   390         // We cannot include JFR event classes because they need runtime-specific
       
   391         // instrumentation in order to work with -XX:FlightRecorderOptions=retransform=false.
       
   392         // There are only a small number of these classes, so it's not worthwhile to
       
   393         // support them and make CDS more complicated.
       
   394         ResourceMark rm;
       
   395         tty->print_cr("Skipping JFR event class %s", ik->name()->as_C_string());
   378         free_entry(p);
   396         free_entry(p);
   379       } else {
   397       } else {
   380         p->set_next(master_list);
   398         p->set_next(master_list);
   381         master_list = p;
   399         master_list = p;
   382       }
   400       }
   398     p->set_hash(hash);
   416     p->set_hash(hash);
   399     p->set_next(bucket(index));
   417     p->set_next(bucket(index));
   400     set_entry(index, p);
   418     set_entry(index, p);
   401   }
   419   }
   402 }
   420 }
   403 
   421 #endif
   404 
   422 
   405 SymbolPropertyTable::SymbolPropertyTable(int table_size)
   423 SymbolPropertyTable::SymbolPropertyTable(int table_size)
   406   : Hashtable<Symbol*, mtSymbol>(table_size, sizeof(SymbolPropertyEntry))
   424   : Hashtable<Symbol*, mtSymbol>(table_size, sizeof(SymbolPropertyEntry))
   407 {
   425 {
   408 }
   426 }