Mercurial > hg > graal-compiler
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompilerToVM.cpp Tue Feb 17 16:31:39 2015 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Tue Feb 17 16:32:47 2015 +0100 @@ -240,13 +240,40 @@ class_loader = accessing_klass->class_loader(); protection_domain = accessing_klass->protection_domain(); - if (resolve) { - resolved_klass = SystemDictionary::resolve_or_fail(class_name, class_loader, protection_domain, true, THREAD); + resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK_NULL); } else { - resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, THREAD); + if (class_name->byte_at(0) == 'L' && + class_name->byte_at(class_name->utf8_length()-1) == ';') { + // This is a name from a signature. Strip off the trimmings. + // Call recursive to keep scope of strippedsym. + TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1, + class_name->utf8_length()-2, + CHECK_NULL); + resolved_klass = SystemDictionary::find(strippedsym, class_loader, protection_domain, CHECK_NULL); + } else if (FieldType::is_array(class_name)) { + FieldArrayInfo fd; + // dimension and object_key in FieldArrayInfo are assigned as a side-effect + // of this call + BasicType t = FieldType::get_array_info(class_name, fd, CHECK_NULL); + if (t == T_OBJECT) { + TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1+fd.dimension(), + class_name->utf8_length()-2-fd.dimension(), + CHECK_NULL); + // naked oop "k" is OK here -- we assign back into it + resolved_klass = SystemDictionary::find(strippedsym, + class_loader, + protection_domain, + CHECK_NULL); + if (resolved_klass != NULL) { + resolved_klass = resolved_klass->array_klass(fd.dimension(), CHECK_NULL); + } + } else { + resolved_klass = Universe::typeArrayKlassObj(t); + resolved_klass = TypeArrayKlass::cast(resolved_klass)->array_klass(fd.dimension(), CHECK_NULL); + } + } } - return (jlong) (address) resolved_klass; C2V_END