< prev index next >

src/hotspot/share/ci/ciEnv.cpp

Print this page

        

*** 31,40 **** --- 31,41 ---- #include "ci/ciInstanceKlass.hpp" #include "ci/ciMethod.hpp" #include "ci/ciNullObject.hpp" #include "ci/ciReplay.hpp" #include "ci/ciUtilities.inline.hpp" + #include "ci/ciValueKlass.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "code/codeCache.hpp" #include "code/scopeDesc.hpp"
*** 399,410 **** ASSERT_IN_VM; EXCEPTION_CONTEXT; // Now we need to check the SystemDictionary Symbol* sym = name->get_symbol(); ! if (sym->char_at(0) == 'L' && ! sym->char_at(sym->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(sym->as_utf8()+1, sym->utf8_length()-2); ciSymbol* strippedname = get_symbol(strippedsym); --- 400,411 ---- ASSERT_IN_VM; EXCEPTION_CONTEXT; // Now we need to check the SystemDictionary Symbol* sym = name->get_symbol(); ! if ((sym->starts_with('L') || sym->starts_with('Q')) && ! sym->ends_with(';')) { // This is a name from a signature. Strip off the trimmings. // Call recursive to keep scope of strippedsym. TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1, sym->utf8_length()-2); ciSymbol* strippedname = get_symbol(strippedsym);
*** 453,463 **** // In either case, if we can find the element type in the system dictionary, // we must build an array type around it. The CI requires array klasses // to be loaded if their element klasses are loaded, except when memory // is exhausted. if (sym->char_at(0) == '[' && ! (sym->char_at(1) == '[' || sym->char_at(1) == 'L')) { // We have an unloaded array. // Build it on the fly if the element class exists. TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1, sym->utf8_length()-1); --- 454,464 ---- // In either case, if we can find the element type in the system dictionary, // we must build an array type around it. The CI requires array klasses // to be loaded if their element klasses are loaded, except when memory // is exhausted. if (sym->char_at(0) == '[' && ! (sym->char_at(1) == '[' || sym->char_at(1) == 'L' || sym->char_at(1) == 'Q')) { // We have an unloaded array. // Build it on the fly if the element class exists. TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1, sym->utf8_length()-1);
*** 467,477 **** cpool, get_symbol(elem_sym), require_local); if (elem_klass != NULL && elem_klass->is_loaded()) { // Now make an array for it ! return ciObjArrayKlass::make_impl(elem_klass); } } if (found_klass == NULL && !cpool.is_null() && cpool->has_preresolution()) { // Look inside the constant pool for pre-resolved class entries. --- 468,478 ---- cpool, get_symbol(elem_sym), require_local); if (elem_klass != NULL && elem_klass->is_loaded()) { // Now make an array for it ! return ciArrayKlass::make(elem_klass, sym->char_at(1) == 'Q'); } } if (found_klass == NULL && !cpool.is_null() && cpool->has_preresolution()) { // Look inside the constant pool for pre-resolved class entries.
*** 493,502 **** --- 494,518 ---- if (require_local) return NULL; // Not yet loaded into the VM, or not governed by loader constraints. // Make a CI representative for it. + int i = 0; + while (sym->char_at(i) == '[') { + i++; + } + if (i > 0 && sym->char_at(i) == 'Q') { + // An unloaded array class of value types is an ObjArrayKlass, an + // unloaded value type class is an InstanceKlass. For consistency, + // make the signature of the unloaded array of value type use L + // rather than Q. + char *new_name = CURRENT_THREAD_ENV->name_buffer(sym->utf8_length()+1); + strncpy(new_name, (char*)sym->base(), sym->utf8_length()); + new_name[i] = 'L'; + new_name[sym->utf8_length()] = '\0'; + return get_unloaded_klass(accessing_klass, ciSymbol::make(new_name)); + } return get_unloaded_klass(accessing_klass, name); } // ------------------------------------------------------------------ // ciEnv::get_klass_by_name
*** 523,533 **** if (cpool->tag_at(index).is_symbol()) { klass_name = cpool->symbol_at(index); } else { // Check if it's resolved if it's not a symbol constant pool entry. ! klass = ConstantPool::klass_at_if_loaded(cpool, index); // Try to look it up by name. if (klass == NULL) { klass_name = cpool->klass_name_at(index); } } --- 539,549 ---- if (cpool->tag_at(index).is_symbol()) { klass_name = cpool->symbol_at(index); } else { // Check if it's resolved if it's not a symbol constant pool entry. ! klass = ConstantPool::klass_at_if_loaded(cpool, index); // Try to look it up by name. if (klass == NULL) { klass_name = cpool->klass_name_at(index); } }
*** 576,585 **** --- 592,609 ---- ciInstanceKlass* accessor) { GUARDED_VM_ENTRY(return get_klass_by_index_impl(cpool, index, is_accessible, accessor);) } // ------------------------------------------------------------------ + // ciEnv::is_klass_never_null + // + // Get information about nullability from the constant pool. + bool ciEnv::is_klass_never_null(const constantPoolHandle& cpool, int index) { + GUARDED_VM_ENTRY(return cpool->klass_name_at(index)->is_Q_signature();) + } + + // ------------------------------------------------------------------ // ciEnv::get_constant_by_index_impl // // Implementation of get_constant_by_index(). ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool, int pool_index, int cache_index,
< prev index next >