< prev index next >

src/hotspot/share/opto/chaitin.cpp

Print this page
*** 1814,14 ***
    // NOTE: we use TypePtr instead of TypeOopPtr because we can have
    // pointers derived from null!  These are always along paths that
    // can't happen at run-time but the optimizer cannot deduce it so
    // we have to handle it gracefully.
    assert(!derived->bottom_type()->isa_narrowoop() ||
!           derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
    const TypePtr *tj = derived->bottom_type()->isa_ptr();
    // If its an OOP with a non-zero offset, then it is derived.
!   if( tj == nullptr || tj->_offset == 0 ) {
      derived_base_map[derived->_idx] = derived;
      return derived;
    }
    // Derived is null+offset?  Base is null!
    if( derived->is_Con() ) {
--- 1814,14 ---
    // NOTE: we use TypePtr instead of TypeOopPtr because we can have
    // pointers derived from null!  These are always along paths that
    // can't happen at run-time but the optimizer cannot deduce it so
    // we have to handle it gracefully.
    assert(!derived->bottom_type()->isa_narrowoop() ||
!          derived->bottom_type()->make_ptr()->is_ptr()->offset() == 0, "sanity");
    const TypePtr *tj = derived->bottom_type()->isa_ptr();
    // If its an OOP with a non-zero offset, then it is derived.
!   if (tj == nullptr || tj->offset() == 0) {
      derived_base_map[derived->_idx] = derived;
      return derived;
    }
    // Derived is null+offset?  Base is null!
    if( derived->is_Con() ) {

*** 1983,13 ***
            // Find reaching DEF for base and derived values
            // This works because we are still in SSA during this call.
            Node *derived = lrgs(neighbor)._def;
            const TypePtr *tj = derived->bottom_type()->isa_ptr();
            assert(!derived->bottom_type()->isa_narrowoop() ||
!                   derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
            // If its an OOP with a non-zero offset, then it is derived.
!           if( tj && tj->_offset != 0 && tj->isa_oop_ptr() ) {
              Node *base = find_base_for_derived(derived_base_map, derived, maxlrg);
              assert(base->_idx < _lrg_map.size(), "");
              // Add reaching DEFs of derived pointer and base pointer as a
              // pair of inputs
              n->add_req(derived);
--- 1983,13 ---
            // Find reaching DEF for base and derived values
            // This works because we are still in SSA during this call.
            Node *derived = lrgs(neighbor)._def;
            const TypePtr *tj = derived->bottom_type()->isa_ptr();
            assert(!derived->bottom_type()->isa_narrowoop() ||
!                  derived->bottom_type()->make_ptr()->is_ptr()->offset() == 0, "sanity");
            // If its an OOP with a non-zero offset, then it is derived.
!           if (tj && tj->offset() != 0 && tj->isa_oop_ptr()) {
              Node *base = find_base_for_derived(derived_base_map, derived, maxlrg);
              assert(base->_idx < _lrg_map.size(), "");
              // Add reaching DEFs of derived pointer and base pointer as a
              // pair of inputs
              n->add_req(derived);

*** 2275,11 ***
    }
  }
  
  void PhaseChaitin::dump_frame() const {
    const char *fp = OptoReg::regname(OptoReg::c_frame_pointer);
!   const TypeTuple *domain = C->tf()->domain();
    const int        argcnt = domain->cnt() - TypeFunc::Parms;
  
    // Incoming arguments in registers dump
    for( int k = 0; k < argcnt; k++ ) {
      OptoReg::Name parmreg = _matcher._parm_regs[k].first();
--- 2275,11 ---
    }
  }
  
  void PhaseChaitin::dump_frame() const {
    const char *fp = OptoReg::regname(OptoReg::c_frame_pointer);
!   const TypeTuple *domain = C->tf()->domain_cc();
    const int        argcnt = domain->cnt() - TypeFunc::Parms;
  
    // Incoming arguments in registers dump
    for( int k = 0; k < argcnt; k++ ) {
      OptoReg::Name parmreg = _matcher._parm_regs[k].first();

*** 2484,24 ***
                  } else if (check->is_Phi()) {
                    for (uint m = 1; m < check->req(); m++) {
                      worklist.push(check->in(m));
                    }
                  } else if (check->is_Con()) {
!                   if (is_derived && check->bottom_type()->is_ptr()->_offset != 0) {
                      // Derived is null+non-zero offset, base must be null.
                      assert(check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad derived pointer");
                    } else {
!                     assert(check->bottom_type()->is_ptr()->_offset == 0, "Bad base pointer");
                      // Base either ConP(nullptr) or loadConP
                      if (check->is_Mach()) {
                        assert(check->as_Mach()->ideal_Opcode() == Op_ConP, "Bad base pointer");
                      } else {
                        assert(check->Opcode() == Op_ConP &&
                               check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad base pointer");
                      }
                    }
!                 } else if (check->bottom_type()->is_ptr()->_offset == 0) {
                    if (check->is_Proj() || (check->is_Mach() &&
                       (check->as_Mach()->ideal_Opcode() == Op_CreateEx ||
                        check->as_Mach()->ideal_Opcode() == Op_ThreadLocal ||
                        check->as_Mach()->ideal_Opcode() == Op_CMoveP ||
                        check->as_Mach()->ideal_Opcode() == Op_CheckCastPP ||
--- 2484,24 ---
                  } else if (check->is_Phi()) {
                    for (uint m = 1; m < check->req(); m++) {
                      worklist.push(check->in(m));
                    }
                  } else if (check->is_Con()) {
!                   if (is_derived && check->bottom_type()->is_ptr()->offset() != 0) {
                      // Derived is null+non-zero offset, base must be null.
                      assert(check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad derived pointer");
                    } else {
!                     assert(check->bottom_type()->is_ptr()->offset() == 0, "Bad base pointer");
                      // Base either ConP(nullptr) or loadConP
                      if (check->is_Mach()) {
                        assert(check->as_Mach()->ideal_Opcode() == Op_ConP, "Bad base pointer");
                      } else {
                        assert(check->Opcode() == Op_ConP &&
                               check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad base pointer");
                      }
                    }
!                 } else if (check->bottom_type()->is_ptr()->offset() == 0) {
                    if (check->is_Proj() || (check->is_Mach() &&
                       (check->as_Mach()->ideal_Opcode() == Op_CreateEx ||
                        check->as_Mach()->ideal_Opcode() == Op_ThreadLocal ||
                        check->as_Mach()->ideal_Opcode() == Op_CMoveP ||
                        check->as_Mach()->ideal_Opcode() == Op_CheckCastPP ||
< prev index next >