src/share/vm/classfile/loaderConstraints.hpp

Fri, 27 Feb 2009 13:27:09 -0800

author
twisti
date
Fri, 27 Feb 2009 13:27:09 -0800
changeset 1040
98cb887364d3
parent 435
a61af66fc99e
child 1100
c89f86385056
permissions
-rw-r--r--

6810672: Comment typos
Summary: I have collected some typos I have found while looking at the code.
Reviewed-by: kvn, never

duke@435 1 /*
duke@435 2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 class LoaderConstraintEntry;
duke@435 26
duke@435 27 class LoaderConstraintTable : public Hashtable {
duke@435 28 friend class VMStructs;
duke@435 29 private:
duke@435 30
duke@435 31 enum Constants {
duke@435 32 _loader_constraint_size = 107, // number of entries in constraint table
duke@435 33 _nof_buckets = 1009 // number of buckets in hash table
duke@435 34 };
duke@435 35
duke@435 36 LoaderConstraintEntry** find_loader_constraint(symbolHandle name,
duke@435 37 Handle loader);
duke@435 38
duke@435 39 public:
duke@435 40
duke@435 41 LoaderConstraintTable(int nof_buckets);
duke@435 42
duke@435 43 LoaderConstraintEntry* new_entry(unsigned int hash, symbolOop name,
duke@435 44 klassOop klass, int num_loaders,
duke@435 45 int max_loaders);
duke@435 46
duke@435 47 LoaderConstraintEntry* bucket(int i) {
duke@435 48 return (LoaderConstraintEntry*)Hashtable::bucket(i);
duke@435 49 }
duke@435 50
duke@435 51 LoaderConstraintEntry** bucket_addr(int i) {
duke@435 52 return (LoaderConstraintEntry**)Hashtable::bucket_addr(i);
duke@435 53 }
duke@435 54
duke@435 55 // GC support
duke@435 56 void oops_do(OopClosure* f);
duke@435 57 void always_strong_classes_do(OopClosure* blk);
duke@435 58
duke@435 59 // Check class loader constraints
duke@435 60 bool add_entry(symbolHandle name, klassOop klass1, Handle loader1,
duke@435 61 klassOop klass2, Handle loader2);
duke@435 62
duke@435 63 void check_signature_loaders(symbolHandle signature, Handle loader1,
duke@435 64 Handle loader2, bool is_method, TRAPS);
duke@435 65
duke@435 66 klassOop find_constrained_klass(symbolHandle name, Handle loader);
duke@435 67 klassOop find_constrained_elem_klass(symbolHandle name, symbolHandle elem_name,
duke@435 68 Handle loader, TRAPS);
duke@435 69
duke@435 70
duke@435 71 // Class loader constraints
duke@435 72
duke@435 73 void ensure_loader_constraint_capacity(LoaderConstraintEntry *p, int nfree);
duke@435 74 void extend_loader_constraint(LoaderConstraintEntry* p, Handle loader,
duke@435 75 klassOop klass);
duke@435 76 void merge_loader_constraints(LoaderConstraintEntry** pp1,
duke@435 77 LoaderConstraintEntry** pp2, klassOop klass);
duke@435 78
duke@435 79 bool check_or_update(instanceKlassHandle k, Handle loader,
duke@435 80 symbolHandle name);
duke@435 81
duke@435 82
duke@435 83 void purge_loader_constraints(BoolObjectClosure* is_alive);
duke@435 84
duke@435 85 void verify(Dictionary* dictionary);
duke@435 86 #ifndef PRODUCT
duke@435 87 void print();
duke@435 88 #endif
duke@435 89 };
duke@435 90
duke@435 91 class LoaderConstraintEntry : public HashtableEntry {
duke@435 92 friend class VMStructs;
duke@435 93 private:
duke@435 94 symbolOop _name; // class name
duke@435 95 int _num_loaders;
duke@435 96 int _max_loaders;
duke@435 97 oop* _loaders; // initiating loaders
duke@435 98
duke@435 99 public:
duke@435 100
duke@435 101 klassOop klass() { return (klassOop)literal(); }
duke@435 102 klassOop* klass_addr() { return (klassOop*)literal_addr(); }
duke@435 103 void set_klass(klassOop k) { set_literal(k); }
duke@435 104
duke@435 105 LoaderConstraintEntry* next() {
duke@435 106 return (LoaderConstraintEntry*)HashtableEntry::next();
duke@435 107 }
duke@435 108
duke@435 109 LoaderConstraintEntry** next_addr() {
duke@435 110 return (LoaderConstraintEntry**)HashtableEntry::next_addr();
duke@435 111 }
duke@435 112 void set_next(LoaderConstraintEntry* next) {
duke@435 113 HashtableEntry::set_next(next);
duke@435 114 }
duke@435 115
duke@435 116 symbolOop name() { return _name; }
duke@435 117 symbolOop* name_addr() { return &_name; }
duke@435 118 void set_name(symbolOop name) { _name = name; }
duke@435 119
duke@435 120 int num_loaders() { return _num_loaders; }
duke@435 121 void set_num_loaders(int i) { _num_loaders = i; }
duke@435 122
duke@435 123 int max_loaders() { return _max_loaders; }
duke@435 124 void set_max_loaders(int i) { _max_loaders = i; }
duke@435 125
duke@435 126 oop* loaders() { return _loaders; }
duke@435 127 void set_loaders(oop* loaders) { _loaders = loaders; }
duke@435 128
duke@435 129 oop loader(int i) { return _loaders[i]; }
duke@435 130 oop* loader_addr(int i) { return &_loaders[i]; }
duke@435 131 void set_loader(int i, oop p) { _loaders[i] = p; }
duke@435 132
duke@435 133 };

mercurial