1 /*
2 * Copyright (c) 1999, 2015, 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 *
141 ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
142 int klass_index,
143 bool& is_accessible,
144 ciInstanceKlass* loading_klass);
145 ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
146 int pool_index, int cache_index,
147 ciInstanceKlass* loading_klass);
148 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
149 int field_index);
150 ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
151 int method_index, Bytecodes::Code bc,
152 ciInstanceKlass* loading_klass);
153
154 // Helper methods
155 bool check_klass_accessibility(ciKlass* accessing_klass,
156 Klass* resolved_klass);
157 Method* lookup_method(InstanceKlass* accessor,
158 InstanceKlass* holder,
159 Symbol* name,
160 Symbol* sig,
161 Bytecodes::Code bc);
162
163 // Get a ciObject from the object factory. Ensures uniqueness
164 // of ciObjects.
165 ciObject* get_object(oop o) {
166 if (o == NULL) {
167 return _null_object_instance;
168 } else {
169 return _factory->get(o);
170 }
171 }
172
173 ciSymbol* get_symbol(Symbol* o) {
174 if (o == NULL) {
175 ShouldNotReachHere();
176 return NULL;
177 } else {
178 return _factory->get_symbol(o);
179 }
180 }
181
|
1 /*
2 * Copyright (c) 1999, 2016, 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 *
141 ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
142 int klass_index,
143 bool& is_accessible,
144 ciInstanceKlass* loading_klass);
145 ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
146 int pool_index, int cache_index,
147 ciInstanceKlass* loading_klass);
148 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
149 int field_index);
150 ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
151 int method_index, Bytecodes::Code bc,
152 ciInstanceKlass* loading_klass);
153
154 // Helper methods
155 bool check_klass_accessibility(ciKlass* accessing_klass,
156 Klass* resolved_klass);
157 Method* lookup_method(InstanceKlass* accessor,
158 InstanceKlass* holder,
159 Symbol* name,
160 Symbol* sig,
161 Bytecodes::Code bc,
162 constantTag tag);
163
164 // Get a ciObject from the object factory. Ensures uniqueness
165 // of ciObjects.
166 ciObject* get_object(oop o) {
167 if (o == NULL) {
168 return _null_object_instance;
169 } else {
170 return _factory->get(o);
171 }
172 }
173
174 ciSymbol* get_symbol(Symbol* o) {
175 if (o == NULL) {
176 ShouldNotReachHere();
177 return NULL;
178 } else {
179 return _factory->get_symbol(o);
180 }
181 }
182
|