< prev index next >

src/hotspot/share/opto/parseHelper.cpp

Print this page

        

*** 147,175 **** // Shorthand access to array store elements without popping them. Node *obj = peek(0); Node *idx = peek(1); Node *ary = peek(2); ! const Type* elemtype = _gvn.type(ary)->is_aryptr()->elem(); const TypeOopPtr* elemptr = elemtype->make_oopptr(); bool is_value_array = elemtype->isa_valuetype() != NULL || (elemptr != NULL && elemptr->is_valuetypeptr()); - bool can_be_value_array = is_value_array || (elemptr != NULL && (elemptr->can_be_value_type())); if (_gvn.type(obj) == TypePtr::NULL_PTR) { // There's never a type check on null values. // This cutout lets us avoid the uncommon_trap(Reason_array_check) // below, which turns into a performance liability if the // gen_checkcast folds up completely. - if (is_value_array) { - // Can not store null into a value type array - uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none); - return obj; - } else if (can_be_value_array) { - // Throw exception if array is a value type array - gen_value_type_array_guard(ary, zerocon(T_OBJECT)); - return obj; - } return obj; } // Extract the array klass type Node* array_klass = load_object_klass(ary); --- 147,166 ---- // Shorthand access to array store elements without popping them. Node *obj = peek(0); Node *idx = peek(1); Node *ary = peek(2); ! const TypeAryPtr* ary_t = _gvn.type(ary)->is_aryptr(); ! const Type* elemtype = ary_t->elem(); const TypeOopPtr* elemptr = elemtype->make_oopptr(); bool is_value_array = elemtype->isa_valuetype() != NULL || (elemptr != NULL && elemptr->is_valuetypeptr()); if (_gvn.type(obj) == TypePtr::NULL_PTR) { // There's never a type check on null values. // This cutout lets us avoid the uncommon_trap(Reason_array_check) // below, which turns into a performance liability if the // gen_checkcast folds up completely. return obj; } // Extract the array klass type Node* array_klass = load_object_klass(ary);
*** 250,263 **** if (is_value_array) { // We statically know that this is a value type array, use precise klass ptr ciValueKlass* vk = elemtype->isa_valuetype() ? elemtype->is_valuetype()->value_klass() : elemptr->value_klass(); a_e_klass = makecon(TypeKlassPtr::make(vk)); - } else if (can_be_value_array && !obj->is_ValueType() && _gvn.type(obj)->is_oopptr()->can_be_value_type()) { - // We cannot statically determine if the array is a value type array - // and we also don't know if 'obj' is a value type. Emit runtime checks. - gen_value_type_array_guard(ary, obj, a_e_klass); } // Check (the hard way) and throw if not a subklass. return gen_checkcast(obj, a_e_klass); } --- 241,250 ----
< prev index next >