Mercurial > hg > truffle
comparison src/share/vm/ci/ciField.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | aa07e41a9f80 |
children | e522a00b91aa ad5dd04754ee |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
123 _offset = -1; | 123 _offset = -1; |
124 _is_constant = false; | 124 _is_constant = false; |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 instanceKlass* loaded_decl_holder = declared_holder->get_instanceKlass(); | 128 InstanceKlass* loaded_decl_holder = declared_holder->get_instanceKlass(); |
129 | 129 |
130 // Perform the field lookup. | 130 // Perform the field lookup. |
131 fieldDescriptor field_desc; | 131 fieldDescriptor field_desc; |
132 klassOop canonical_holder = | 132 Klass* canonical_holder = |
133 loaded_decl_holder->find_field(name, signature, &field_desc); | 133 loaded_decl_holder->find_field(name, signature, &field_desc); |
134 if (canonical_holder == NULL) { | 134 if (canonical_holder == NULL) { |
135 // Field lookup failed. Will be detected by will_link. | 135 // Field lookup failed. Will be detected by will_link. |
136 _holder = declared_holder; | 136 _holder = declared_holder; |
137 _offset = -1; | 137 _offset = -1; |
184 | 184 |
185 void ciField::initialize_from(fieldDescriptor* fd) { | 185 void ciField::initialize_from(fieldDescriptor* fd) { |
186 // Get the flags, offset, and canonical holder of the field. | 186 // Get the flags, offset, and canonical holder of the field. |
187 _flags = ciFlags(fd->access_flags()); | 187 _flags = ciFlags(fd->access_flags()); |
188 _offset = fd->offset(); | 188 _offset = fd->offset(); |
189 _holder = CURRENT_ENV->get_object(fd->field_holder())->as_instance_klass(); | 189 _holder = CURRENT_ENV->get_instance_klass(fd->field_holder()); |
190 | 190 |
191 // Check to see if the field is constant. | 191 // Check to see if the field is constant. |
192 if (_holder->is_initialized() && this->is_final()) { | 192 if (_holder->is_initialized() && this->is_final()) { |
193 if (!this->is_static()) { | 193 if (!this->is_static()) { |
194 // A field can be constant if it's a final static field or if | 194 // A field can be constant if it's a final static field or if |
211 // field to be not constant. | 211 // field to be not constant. |
212 // 2. The field is a *special* static&final field whose value | 212 // 2. The field is a *special* static&final field whose value |
213 // may change. The three examples are java.lang.System.in, | 213 // may change. The three examples are java.lang.System.in, |
214 // java.lang.System.out, and java.lang.System.err. | 214 // java.lang.System.out, and java.lang.System.err. |
215 | 215 |
216 KlassHandle k = _holder->get_klassOop(); | 216 KlassHandle k = _holder->get_Klass(); |
217 assert( SystemDictionary::System_klass() != NULL, "Check once per vm"); | 217 assert( SystemDictionary::System_klass() != NULL, "Check once per vm"); |
218 if( k() == SystemDictionary::System_klass() ) { | 218 if( k() == SystemDictionary::System_klass() ) { |
219 // Check offsets for case 2: System.in, System.out, or System.err | 219 // Check offsets for case 2: System.in, System.out, or System.err |
220 if( _offset == java_lang_System::in_offset_in_bytes() || | 220 if( _offset == java_lang_System::in_offset_in_bytes() || |
221 _offset == java_lang_System::out_offset_in_bytes() || | 221 _offset == java_lang_System::out_offset_in_bytes() || |