1 /*
2 * Copyright (c) 1999, 2007, 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 // ciObjectFactory
26 //
27 // This class handles requests for the creation of new instances
28 // of ciObject and its subclasses. It contains a caching mechanism
29 // which ensures that for each oop, at most one ciObject is created.
30 // This invariant allows efficient implementation of ciObject.
31 class ciObjectFactory : public ResourceObj {
32 private:
33 static volatile bool _initialized;
34 static GrowableArray<ciObject*>* _shared_ci_objects;
35 static ciSymbol* _shared_ci_symbols[];
36 static int _shared_ident_limit;
37
38 Arena* _arena;
39 GrowableArray<ciObject*>* _ci_objects;
40 GrowableArray<ciMethod*>* _unloaded_methods;
41 GrowableArray<ciKlass*>* _unloaded_klasses;
42 GrowableArray<ciInstance*>* _unloaded_instances;
43 GrowableArray<ciReturnAddress*>* _return_addresses;
44 int _next_ident;
106
107 // Get a ciInstance representing an unresolved method handle constant.
108 ciInstance* get_unloaded_method_handle_constant(ciKlass* holder,
109 ciSymbol* name,
110 ciSymbol* signature,
111 int ref_kind);
112
113 // Get a ciInstance representing an unresolved method type constant.
114 ciInstance* get_unloaded_method_type_constant(ciSymbol* signature);
115
116
117 // Get the ciMethodData representing the methodData for a method
118 // with none.
119 ciMethodData* get_empty_methodData();
120
121 ciReturnAddress* get_return_address(int bci);
122
123 void print_contents();
124 void print();
125 };
|
1 /*
2 * Copyright (c) 1999, 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_CI_CIOBJECTFACTORY_HPP
26 #define SHARE_VM_CI_CIOBJECTFACTORY_HPP
27
28 #include "ci/ciClassList.hpp"
29 #include "ci/ciObject.hpp"
30 #include "utilities/growableArray.hpp"
31
32 // ciObjectFactory
33 //
34 // This class handles requests for the creation of new instances
35 // of ciObject and its subclasses. It contains a caching mechanism
36 // which ensures that for each oop, at most one ciObject is created.
37 // This invariant allows efficient implementation of ciObject.
38 class ciObjectFactory : public ResourceObj {
39 private:
40 static volatile bool _initialized;
41 static GrowableArray<ciObject*>* _shared_ci_objects;
42 static ciSymbol* _shared_ci_symbols[];
43 static int _shared_ident_limit;
44
45 Arena* _arena;
46 GrowableArray<ciObject*>* _ci_objects;
47 GrowableArray<ciMethod*>* _unloaded_methods;
48 GrowableArray<ciKlass*>* _unloaded_klasses;
49 GrowableArray<ciInstance*>* _unloaded_instances;
50 GrowableArray<ciReturnAddress*>* _return_addresses;
51 int _next_ident;
113
114 // Get a ciInstance representing an unresolved method handle constant.
115 ciInstance* get_unloaded_method_handle_constant(ciKlass* holder,
116 ciSymbol* name,
117 ciSymbol* signature,
118 int ref_kind);
119
120 // Get a ciInstance representing an unresolved method type constant.
121 ciInstance* get_unloaded_method_type_constant(ciSymbol* signature);
122
123
124 // Get the ciMethodData representing the methodData for a method
125 // with none.
126 ciMethodData* get_empty_methodData();
127
128 ciReturnAddress* get_return_address(int bci);
129
130 void print_contents();
131 void print();
132 };
133
134 #endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP
|