1 /*
2 * Copyright (c) 1999, 2012, 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 *
36 // The lookup may not succeed, in which case the information in
37 // the ciField will be incomplete.
38 class ciField : public ResourceObj {
39 CI_PACKAGE_ACCESS
40 friend class ciEnv;
41 friend class ciInstanceKlass;
42 friend class NonStaticFieldFiller;
43
44 private:
45 ciFlags _flags;
46 ciInstanceKlass* _holder;
47 ciSymbol* _name;
48 ciSymbol* _signature;
49 ciType* _type;
50 int _offset;
51 bool _is_constant;
52 ciInstanceKlass* _known_to_link_with_put;
53 ciInstanceKlass* _known_to_link_with_get;
54 ciConstant _constant_value;
55
56 // Used for will_link
57 int _cp_index;
58
59 ciType* compute_type();
60 ciType* compute_type_impl();
61
62 ciField(ciInstanceKlass* klass, int index);
63 ciField(fieldDescriptor* fd);
64
65 // shared constructor code
66 void initialize_from(fieldDescriptor* fd);
67
68 public:
69 ciFlags flags() { return _flags; }
70
71 // Of which klass is this field a member?
72 //
73 // Usage note: the declared holder of a field is the class
74 // referenced by name in the bytecodes. The canonical holder
75 // is the most general class which holds the field. This
76 // method returns the canonical holder. The declared holder
77 // can be accessed via a method in ciBytecodeStream.
78 //
|
1 /*
2 * Copyright (c) 1999, 2013, 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 *
36 // The lookup may not succeed, in which case the information in
37 // the ciField will be incomplete.
38 class ciField : public ResourceObj {
39 CI_PACKAGE_ACCESS
40 friend class ciEnv;
41 friend class ciInstanceKlass;
42 friend class NonStaticFieldFiller;
43
44 private:
45 ciFlags _flags;
46 ciInstanceKlass* _holder;
47 ciSymbol* _name;
48 ciSymbol* _signature;
49 ciType* _type;
50 int _offset;
51 bool _is_constant;
52 ciInstanceKlass* _known_to_link_with_put;
53 ciInstanceKlass* _known_to_link_with_get;
54 ciConstant _constant_value;
55
56 ciType* compute_type();
57 ciType* compute_type_impl();
58
59 ciField(ciInstanceKlass* klass, int index);
60 ciField(fieldDescriptor* fd);
61
62 // shared constructor code
63 void initialize_from(fieldDescriptor* fd);
64
65 public:
66 ciFlags flags() { return _flags; }
67
68 // Of which klass is this field a member?
69 //
70 // Usage note: the declared holder of a field is the class
71 // referenced by name in the bytecodes. The canonical holder
72 // is the most general class which holds the field. This
73 // method returns the canonical holder. The declared holder
74 // can be accessed via a method in ciBytecodeStream.
75 //
|