1 /*
2 * Copyright (c) 2003, 2009, 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 *
23 */
24
25 class LoaderConstraintEntry;
26
27 class LoaderConstraintTable : public Hashtable {
28 friend class VMStructs;
29 private:
30
31 enum Constants {
32 _loader_constraint_size = 107, // number of entries in constraint table
33 _nof_buckets = 1009 // number of buckets in hash table
34 };
35
36 LoaderConstraintEntry** find_loader_constraint(symbolHandle name,
37 Handle loader);
38
39 public:
40
41 LoaderConstraintTable(int nof_buckets);
42
43 LoaderConstraintEntry* new_entry(unsigned int hash, symbolOop name,
44 klassOop klass, int num_loaders,
113 }
114
115 symbolOop name() { return _name; }
116 symbolOop* name_addr() { return &_name; }
117 void set_name(symbolOop name) { _name = name; }
118
119 int num_loaders() { return _num_loaders; }
120 void set_num_loaders(int i) { _num_loaders = i; }
121
122 int max_loaders() { return _max_loaders; }
123 void set_max_loaders(int i) { _max_loaders = i; }
124
125 oop* loaders() { return _loaders; }
126 void set_loaders(oop* loaders) { _loaders = loaders; }
127
128 oop loader(int i) { return _loaders[i]; }
129 oop* loader_addr(int i) { return &_loaders[i]; }
130 void set_loader(int i, oop p) { _loaders[i] = p; }
131
132 };
|
1 /*
2 * Copyright (c) 2003, 2010, 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 *
23 */
24
25 #ifndef SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
26 #define SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
27
28 #include "classfile/dictionary.hpp"
29 #include "classfile/placeholders.hpp"
30 #include "utilities/hashtable.hpp"
31
32 class LoaderConstraintEntry;
33
34 class LoaderConstraintTable : public Hashtable {
35 friend class VMStructs;
36 private:
37
38 enum Constants {
39 _loader_constraint_size = 107, // number of entries in constraint table
40 _nof_buckets = 1009 // number of buckets in hash table
41 };
42
43 LoaderConstraintEntry** find_loader_constraint(symbolHandle name,
44 Handle loader);
45
46 public:
47
48 LoaderConstraintTable(int nof_buckets);
49
50 LoaderConstraintEntry* new_entry(unsigned int hash, symbolOop name,
51 klassOop klass, int num_loaders,
120 }
121
122 symbolOop name() { return _name; }
123 symbolOop* name_addr() { return &_name; }
124 void set_name(symbolOop name) { _name = name; }
125
126 int num_loaders() { return _num_loaders; }
127 void set_num_loaders(int i) { _num_loaders = i; }
128
129 int max_loaders() { return _max_loaders; }
130 void set_max_loaders(int i) { _max_loaders = i; }
131
132 oop* loaders() { return _loaders; }
133 void set_loaders(oop* loaders) { _loaders = loaders; }
134
135 oop loader(int i) { return _loaders[i]; }
136 oop* loader_addr(int i) { return &_loaders[i]; }
137 void set_loader(int i, oop p) { _loaders[i] = p; }
138
139 };
140
141 #endif // SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
|