< prev index next >

src/hotspot/share/opto/library_call.cpp

Print this page

1974     // Offset is small => always a heap address.
1975     const TypeX* offset_type = _gvn.type(offset)->isa_intptr_t();
1976     if (offset_type != NULL &&
1977         base_type->offset() == 0 &&     // (should always be?)
1978         offset_type->_lo >= 0 &&
1979         !MacroAssembler::needs_explicit_null_check(offset_type->_hi)) {
1980       return Type::OopPtr;
1981     } else if (type == T_OBJECT) {
1982       // off heap access to an oop doesn't make any sense. Has to be on
1983       // heap.
1984       return Type::OopPtr;
1985     }
1986     // Otherwise, it might either be oop+off or NULL+addr.
1987     return Type::AnyPtr;
1988   } else {
1989     // No information:
1990     return Type::AnyPtr;
1991   }
1992 }
1993 
1994 inline Node* LibraryCallKit::make_unsafe_address(Node*& base, Node* offset, DecoratorSet decorators, BasicType type, bool can_cast) {
1995   Node* uncasted_base = base;
1996   int kind = classify_unsafe_addr(uncasted_base, offset, type);
1997   if (kind == Type::RawPtr) {
1998     return basic_plus_adr(top(), uncasted_base, offset);
1999   } else if (kind == Type::AnyPtr) {
2000     assert(base == uncasted_base, "unexpected base change");
2001     if (can_cast) {
2002       if (!_gvn.type(base)->speculative_maybe_null() &&
2003           !too_many_traps(Deoptimization::Reason_speculate_null_check)) {
2004         // According to profiling, this access is always on
2005         // heap. Casting the base to not null and thus avoiding membars
2006         // around the access should allow better optimizations
2007         Node* null_ctl = top();
2008         base = null_check_oop(base, &null_ctl, true, true, true);
2009         assert(null_ctl->is_top(), "no null control here");
2010         return basic_plus_adr(base, offset);
2011       } else if (_gvn.type(base)->speculative_always_null() &&
2012                  !too_many_traps(Deoptimization::Reason_speculate_null_assert)) {
2013         // According to profiling, this access is always off
2014         // heap.

1974     // Offset is small => always a heap address.
1975     const TypeX* offset_type = _gvn.type(offset)->isa_intptr_t();
1976     if (offset_type != NULL &&
1977         base_type->offset() == 0 &&     // (should always be?)
1978         offset_type->_lo >= 0 &&
1979         !MacroAssembler::needs_explicit_null_check(offset_type->_hi)) {
1980       return Type::OopPtr;
1981     } else if (type == T_OBJECT) {
1982       // off heap access to an oop doesn't make any sense. Has to be on
1983       // heap.
1984       return Type::OopPtr;
1985     }
1986     // Otherwise, it might either be oop+off or NULL+addr.
1987     return Type::AnyPtr;
1988   } else {
1989     // No information:
1990     return Type::AnyPtr;
1991   }
1992 }
1993 
1994 Node* LibraryCallKit::make_unsafe_address(Node*& base, Node* offset, DecoratorSet decorators, BasicType type, bool can_cast) {
1995   Node* uncasted_base = base;
1996   int kind = classify_unsafe_addr(uncasted_base, offset, type);
1997   if (kind == Type::RawPtr) {
1998     return basic_plus_adr(top(), uncasted_base, offset);
1999   } else if (kind == Type::AnyPtr) {
2000     assert(base == uncasted_base, "unexpected base change");
2001     if (can_cast) {
2002       if (!_gvn.type(base)->speculative_maybe_null() &&
2003           !too_many_traps(Deoptimization::Reason_speculate_null_check)) {
2004         // According to profiling, this access is always on
2005         // heap. Casting the base to not null and thus avoiding membars
2006         // around the access should allow better optimizations
2007         Node* null_ctl = top();
2008         base = null_check_oop(base, &null_ctl, true, true, true);
2009         assert(null_ctl->is_top(), "no null control here");
2010         return basic_plus_adr(base, offset);
2011       } else if (_gvn.type(base)->speculative_always_null() &&
2012                  !too_many_traps(Deoptimization::Reason_speculate_null_assert)) {
2013         // According to profiling, this access is always off
2014         // heap.
< prev index next >