Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/vm/ci/ciObjectFactory.hpp
+++ new/src/share/vm/ci/ciObjectFactory.hpp
1 1 /*
2 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
19 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 * or visit www.oracle.com if you need additional information or have any
21 21 * questions.
22 22 *
23 23 */
24 24
25 25 #ifndef SHARE_VM_CI_CIOBJECTFACTORY_HPP
26 26 #define SHARE_VM_CI_CIOBJECTFACTORY_HPP
27 27
28 28 #include "ci/ciClassList.hpp"
29 29 #include "ci/ciObject.hpp"
30 30 #include "utilities/growableArray.hpp"
31 31
32 32 // ciObjectFactory
33 33 //
34 34 // This class handles requests for the creation of new instances
35 35 // of ciObject and its subclasses. It contains a caching mechanism
36 36 // which ensures that for each oop, at most one ciObject is created.
37 37 // This invariant allows efficient implementation of ciObject.
38 38 class ciObjectFactory : public ResourceObj {
39 39 friend class VMStructs;
40 40 friend class ciEnv;
41 41
42 42 private:
43 43 static volatile bool _initialized;
44 44 static GrowableArray<ciObject*>* _shared_ci_objects;
45 45 static ciSymbol* _shared_ci_symbols[];
46 46 static int _shared_ident_limit;
47 47
48 48 Arena* _arena;
49 49 GrowableArray<ciObject*>* _ci_objects;
50 50 GrowableArray<ciMethod*>* _unloaded_methods;
51 51 GrowableArray<ciKlass*>* _unloaded_klasses;
52 52 GrowableArray<ciInstance*>* _unloaded_instances;
53 53 GrowableArray<ciReturnAddress*>* _return_addresses;
54 54 GrowableArray<ciSymbol*>* _symbols; // keep list of symbols created
55 55 int _next_ident;
56 56
57 57 public:
58 58 struct NonPermObject : public ResourceObj {
59 59 ciObject* _object;
60 60 NonPermObject* _next;
61 61
62 62 inline NonPermObject(NonPermObject* &bucket, oop key, ciObject* object);
63 63 ciObject* object() { return _object; }
64 64 NonPermObject* &next() { return _next; }
65 65 };
66 66 private:
67 67 enum { NON_PERM_BUCKETS = 61 };
68 68 NonPermObject* _non_perm_bucket[NON_PERM_BUCKETS];
69 69 int _non_perm_count;
70 70
71 71 int find(oop key, GrowableArray<ciObject*>* objects);
72 72 bool is_found_at(int index, oop key, GrowableArray<ciObject*>* objects);
73 73 void insert(int index, ciObject* obj, GrowableArray<ciObject*>* objects);
74 74 ciObject* create_new_object(oop o);
75 75 static bool is_equal(NonPermObject* p, oop key) {
76 76 return p->object()->get_oop() == key;
77 77 }
78 78
79 79 NonPermObject* &find_non_perm(oop key);
80 80 void insert_non_perm(NonPermObject* &where, oop key, ciObject* obj);
81 81
82 82 void init_ident_of(ciObject* obj);
83 83 void init_ident_of(ciSymbol* obj);
84 84
85 85 Arena* arena() { return _arena; }
86 86
87 87 void print_contents_impl();
88 88
89 89 ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
90 90
91 91 public:
92 92 static bool is_initialized() { return _initialized; }
93 93
94 94 static void initialize();
95 95 void init_shared_objects();
96 96 void remove_symbols();
97 97
98 98 ciObjectFactory(Arena* arena, int expected_size);
99 99
100 100 // Get the ciObject corresponding to some oop.
↓ open down ↓ |
100 lines elided |
↑ open up ↑ |
101 101 ciObject* get(oop key);
102 102
103 103 ciSymbol* get_symbol(Symbol* key);
104 104
105 105 // Get the ciSymbol corresponding to one of the vmSymbols.
106 106 static ciSymbol* vm_symbol_at(int index);
107 107
108 108 // Get the ciMethod representing an unloaded/unfound method.
109 109 ciMethod* get_unloaded_method(ciInstanceKlass* holder,
110 110 ciSymbol* name,
111 - ciSymbol* signature);
111 + ciSymbol* signature,
112 + ciInstanceKlass* accessor);
112 113
113 114 // Get a ciKlass representing an unloaded klass.
114 115 ciKlass* get_unloaded_klass(ciKlass* accessing_klass,
115 116 ciSymbol* name,
116 117 bool create_if_not_found);
117 118
118 119 // Get a ciInstance representing an unresolved klass mirror.
119 120 ciInstance* get_unloaded_klass_mirror(ciKlass* type);
120 121
121 122 // Get a ciInstance representing an unresolved method handle constant.
122 123 ciInstance* get_unloaded_method_handle_constant(ciKlass* holder,
123 124 ciSymbol* name,
124 125 ciSymbol* signature,
125 126 int ref_kind);
126 127
127 128 // Get a ciInstance representing an unresolved method type constant.
128 129 ciInstance* get_unloaded_method_type_constant(ciSymbol* signature);
129 130
130 131
131 132 // Get the ciMethodData representing the methodData for a method
132 133 // with none.
133 134 ciMethodData* get_empty_methodData();
134 135
135 136 ciReturnAddress* get_return_address(int bci);
136 137
137 138 void print_contents();
138 139 void print();
139 140 };
140 141
141 142 #endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX