comparison src/share/vm/graal/graalCompilerToVM.cpp @ 19451:2452e881fad5

Do not eagerly resolve types in lookupType.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 17 Feb 2015 16:32:47 +0100
parents 8f2fb6bec986
children 398988a77716
comparison
equal deleted inserted replaced
19450:fb20fbfd6a85 19451:2452e881fad5
238 } 238 }
239 Klass* accessing_klass = java_lang_Class::as_Klass(JNIHandles::resolve(accessing_class)); 239 Klass* accessing_klass = java_lang_Class::as_Klass(JNIHandles::resolve(accessing_class));
240 class_loader = accessing_klass->class_loader(); 240 class_loader = accessing_klass->class_loader();
241 protection_domain = accessing_klass->protection_domain(); 241 protection_domain = accessing_klass->protection_domain();
242 242
243
244 if (resolve) { 243 if (resolve) {
245 resolved_klass = SystemDictionary::resolve_or_fail(class_name, class_loader, protection_domain, true, THREAD); 244 resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
246 } else { 245 } else {
247 resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, THREAD); 246 if (class_name->byte_at(0) == 'L' &&
248 } 247 class_name->byte_at(class_name->utf8_length()-1) == ';') {
249 248 // This is a name from a signature. Strip off the trimmings.
249 // Call recursive to keep scope of strippedsym.
250 TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1,
251 class_name->utf8_length()-2,
252 CHECK_NULL);
253 resolved_klass = SystemDictionary::find(strippedsym, class_loader, protection_domain, CHECK_NULL);
254 } else if (FieldType::is_array(class_name)) {
255 FieldArrayInfo fd;
256 // dimension and object_key in FieldArrayInfo are assigned as a side-effect
257 // of this call
258 BasicType t = FieldType::get_array_info(class_name, fd, CHECK_NULL);
259 if (t == T_OBJECT) {
260 TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1+fd.dimension(),
261 class_name->utf8_length()-2-fd.dimension(),
262 CHECK_NULL);
263 // naked oop "k" is OK here -- we assign back into it
264 resolved_klass = SystemDictionary::find(strippedsym,
265 class_loader,
266 protection_domain,
267 CHECK_NULL);
268 if (resolved_klass != NULL) {
269 resolved_klass = resolved_klass->array_klass(fd.dimension(), CHECK_NULL);
270 }
271 } else {
272 resolved_klass = Universe::typeArrayKlassObj(t);
273 resolved_klass = TypeArrayKlass::cast(resolved_klass)->array_klass(fd.dimension(), CHECK_NULL);
274 }
275 }
276 }
250 return (jlong) (address) resolved_klass; 277 return (jlong) (address) resolved_klass;
251 C2V_END 278 C2V_END
252 279
253 C2V_VMENTRY(jobject, resolveConstantInPool, (JNIEnv*, jobject, jlong metaspace_constant_pool, jint index)) 280 C2V_VMENTRY(jobject, resolveConstantInPool, (JNIEnv*, jobject, jlong metaspace_constant_pool, jint index))
254 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool; 281 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool;