equal
deleted
inserted
replaced
175 return false; |
175 return false; |
176 if (holder->name() == ciSymbol::java_lang_System()) |
176 if (holder->name() == ciSymbol::java_lang_System()) |
177 // Never trust strangely unstable finals: System.out, etc. |
177 // Never trust strangely unstable finals: System.out, etc. |
178 return false; |
178 return false; |
179 // Even if general trusting is disabled, trust system-built closures in these packages. |
179 // Even if general trusting is disabled, trust system-built closures in these packages. |
180 if (holder->is_in_package("java/dyn") || holder->is_in_package("sun/dyn")) |
180 if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke")) |
181 return true; |
181 return true; |
182 return TrustFinalNonStaticFields; |
182 return TrustFinalNonStaticFields; |
183 } |
183 } |
184 |
184 |
185 void ciField::initialize_from(fieldDescriptor* fd) { |
185 void ciField::initialize_from(fieldDescriptor* fd) { |
189 _holder = CURRENT_ENV->get_object(fd->field_holder())->as_instance_klass(); |
189 _holder = CURRENT_ENV->get_object(fd->field_holder())->as_instance_klass(); |
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 it's |
194 // A field can be constant if it's a final static field or if |
195 // a final non-static field of a trusted class ({java,sun}.dyn). |
195 // it's a final non-static field of a trusted class (classes in |
|
196 // java.lang.invoke and sun.invoke packages and subpackages). |
196 if (trust_final_non_static_fields(_holder)) { |
197 if (trust_final_non_static_fields(_holder)) { |
197 _is_constant = true; |
198 _is_constant = true; |
198 return; |
199 return; |
199 } |
200 } |
200 _is_constant = false; |
201 _is_constant = false; |