< prev index next >
src/hotspot/share/ci/ciEnv.cpp
Print this page
*** 411,426 ****
ASSERT_IN_VM;
EXCEPTION_CONTEXT;
// Now we need to check the SystemDictionary
Symbol* sym = name->get_symbol();
! if (sym->char_at(0) == JVM_SIGNATURE_CLASS &&
! sym->char_at(sym->utf8_length()-1) == JVM_SIGNATURE_ENDCLASS) {
// 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);
return get_klass_by_name_impl(accessing_klass, cpool, strippedname, require_local);
}
// Check for prior unloaded klass. The SystemDictionary's answers
--- 411,424 ----
ASSERT_IN_VM;
EXCEPTION_CONTEXT;
// Now we need to check the SystemDictionary
Symbol* sym = name->get_symbol();
! if (Signature::has_envelope(sym)) {
// This is a name from a signature. Strip off the trimmings.
// Call recursive to keep scope of strippedsym.
! TempNewSymbol strippedsym = Signature::strip_envelope(sym);
ciSymbol* strippedname = get_symbol(strippedsym);
return get_klass_by_name_impl(accessing_klass, cpool, strippedname, require_local);
}
// Check for prior unloaded klass. The SystemDictionary's answers
*** 464,485 ****
// The element type may be available either locally or via constraints.
// 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) == JVM_SIGNATURE_ARRAY &&
(sym->char_at(1) == JVM_SIGNATURE_ARRAY || sym->char_at(1) == JVM_SIGNATURE_CLASS)) {
// 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);
!
// Get element ciKlass recursively.
ciKlass* elem_klass =
get_klass_by_name_impl(accessing_klass,
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);
}
--- 462,482 ----
// The element type may be available either locally or via constraints.
// 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 (Signature::is_array(sym) &&
(sym->char_at(1) == JVM_SIGNATURE_ARRAY || sym->char_at(1) == JVM_SIGNATURE_CLASS)) {
// We have an unloaded array.
// Build it on the fly if the element class exists.
! SignatureStream ss(sym, false);
! ss.skip_array_prefix(1);
// Get element ciKlass recursively.
ciKlass* elem_klass =
get_klass_by_name_impl(accessing_klass,
cpool,
! get_symbol(ss.as_symbol()),
require_local);
if (elem_klass != NULL && elem_klass->is_loaded()) {
// Now make an array for it
return ciObjArrayKlass::make_impl(elem_klass);
}
*** 607,617 ****
if (obj == Universe::the_null_sentinel()) {
return ciConstant(T_OBJECT, get_object(NULL));
}
BasicType bt = T_OBJECT;
if (cpool->tag_at(index).is_dynamic_constant())
! bt = FieldType::basic_type(cpool->uncached_signature_ref_at(index));
if (is_reference_type(bt)) {
} else {
// we have to unbox the primitive value
if (!is_java_primitive(bt)) return ciConstant();
jvalue value;
--- 604,614 ----
if (obj == Universe::the_null_sentinel()) {
return ciConstant(T_OBJECT, get_object(NULL));
}
BasicType bt = T_OBJECT;
if (cpool->tag_at(index).is_dynamic_constant())
! bt = Signature::basic_type(cpool->uncached_signature_ref_at(index));
if (is_reference_type(bt)) {
} else {
// we have to unbox the primitive value
if (!is_java_primitive(bt)) return ciConstant();
jvalue value;
*** 789,798 ****
--- 786,797 ----
// ------------------------------------------------------------------
// ciEnv::get_method_by_index_impl
ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
int index, Bytecodes::Code bc,
ciInstanceKlass* accessor) {
+ assert(cpool.not_null(), "need constant pool");
+ assert(accessor != NULL, "need origin of access");
if (bc == Bytecodes::_invokedynamic) {
ConstantPoolCacheEntry* cpce = cpool->invokedynamic_cp_cache_entry_at(index);
bool is_resolved = !cpce->is_f1_null();
// FIXME: code generation could allow for null (unlinked) call site
// The call site could be made patchable as follows:
< prev index next >