3416 case Op_LoadUS: 3417 case Op_LoadI: 3418 case Op_LoadKlass: 3419 case Op_LoadNKlass: 3420 case Op_LoadL: 3421 case Op_LoadL_unaligned: 3422 case Op_LoadPLocked: 3423 case Op_LoadP: 3424 case Op_LoadN: 3425 case Op_LoadRange: 3426 case Op_LoadS: { 3427 handle_mem: 3428 #ifdef ASSERT 3429 if( VerifyOptoOopOffsets ) { 3430 MemNode* mem = n->as_Mem(); 3431 // Check to see if address types have grounded out somehow. 3432 const TypeInstPtr *tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr(); 3433 assert( !tp || oop_offset_is_sane(tp), "" ); 3434 } 3435 #endif 3436 if (EnableValhalla && (nop == Op_LoadKlass || nop == Op_LoadNKlass)) { 3437 const TypeKlassPtr* tk = n->bottom_type()->make_ptr()->is_klassptr(); 3438 assert(!tk->klass_is_exact(), "should have been folded"); 3439 if (tk->klass()->can_be_value_array_klass() && n->as_Mem()->adr_type()->offset() == oopDesc::klass_offset_in_bytes()) { 3440 // Array load klass needs to filter out property bits (but not 3441 // GetNullFreePropertyNode or GetFlattenedPropertyNode which 3442 // needs to extract the storage property bits) 3443 uint last = unique(); 3444 Node* pointer = NULL; 3445 if (nop == Op_LoadKlass) { 3446 Node* cast = new CastP2XNode(NULL, n); 3447 Node* masked = new LShiftXNode(cast, new ConINode(TypeInt::make(oopDesc::storage_props_nof_bits))); 3448 masked = new RShiftXNode(masked, new ConINode(TypeInt::make(oopDesc::storage_props_nof_bits))); 3449 pointer = new CastX2PNode(masked); 3450 pointer = new CheckCastPPNode(NULL, pointer, n->bottom_type()); 3451 } else { 3452 Node* cast = new CastN2INode(n); 3453 Node* masked = new AndINode(cast, new ConINode(TypeInt::make(oopDesc::compressed_klass_mask()))); 3454 pointer = new CastI2NNode(masked, n->bottom_type()); 3455 } 3456 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { 3457 Node* u = n->fast_out(i); 3458 if (u->_idx < last && u->Opcode() != Op_GetNullFreeProperty && u->Opcode() != Op_GetFlattenedProperty) { 3459 // If user is a comparison with a klass that can't be a value type | 3416 case Op_LoadUS: 3417 case Op_LoadI: 3418 case Op_LoadKlass: 3419 case Op_LoadNKlass: 3420 case Op_LoadL: 3421 case Op_LoadL_unaligned: 3422 case Op_LoadPLocked: 3423 case Op_LoadP: 3424 case Op_LoadN: 3425 case Op_LoadRange: 3426 case Op_LoadS: { 3427 handle_mem: 3428 #ifdef ASSERT 3429 if( VerifyOptoOopOffsets ) { 3430 MemNode* mem = n->as_Mem(); 3431 // Check to see if address types have grounded out somehow. 3432 const TypeInstPtr *tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr(); 3433 assert( !tp || oop_offset_is_sane(tp), "" ); 3434 } 3435 #endif 3436 if (EnableValhalla && 3437 ((nop == Op_LoadKlass && ((LoadKlassNode*)n)->clear_prop_bits()) || 3438 (nop == Op_LoadNKlass && ((LoadNKlassNode*)n)->clear_prop_bits()))) { 3439 const TypeKlassPtr* tk = n->bottom_type()->make_ptr()->is_klassptr(); 3440 assert(!tk->klass_is_exact(), "should have been folded"); 3441 assert(n->as_Mem()->adr_type()->offset() == oopDesc::klass_offset_in_bytes(), "unexpected LoadKlass"); 3442 if (tk->klass()->can_be_value_array_klass()) { 3443 // Array load klass needs to filter out property bits (but not 3444 // GetNullFreePropertyNode or GetFlattenedPropertyNode which 3445 // needs to extract the storage property bits) 3446 uint last = unique(); 3447 Node* pointer = NULL; 3448 if (nop == Op_LoadKlass) { 3449 Node* cast = new CastP2XNode(NULL, n); 3450 Node* masked = new LShiftXNode(cast, new ConINode(TypeInt::make(oopDesc::storage_props_nof_bits))); 3451 masked = new RShiftXNode(masked, new ConINode(TypeInt::make(oopDesc::storage_props_nof_bits))); 3452 pointer = new CastX2PNode(masked); 3453 pointer = new CheckCastPPNode(NULL, pointer, n->bottom_type()); 3454 } else { 3455 Node* cast = new CastN2INode(n); 3456 Node* masked = new AndINode(cast, new ConINode(TypeInt::make(oopDesc::compressed_klass_mask()))); 3457 pointer = new CastI2NNode(masked, n->bottom_type()); 3458 } 3459 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { 3460 Node* u = n->fast_out(i); 3461 if (u->_idx < last && u->Opcode() != Op_GetNullFreeProperty && u->Opcode() != Op_GetFlattenedProperty) { 3462 // If user is a comparison with a klass that can't be a value type |