< prev index next >

src/hotspot/share/opto/chaitin.cpp

Print this page
@@ -1939,14 +1939,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");
+          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 ) {
+   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() ) {

@@ -2108,13 +2108,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");
+                  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() ) {
+           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);

@@ -2400,11 +2400,11 @@
    }
  }
  
  void PhaseChaitin::dump_frame() const {
    const char *fp = OptoReg::regname(OptoReg::c_frame_pointer);
-   const TypeTuple *domain = C->tf()->domain();
+   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();

@@ -2461,11 +2461,31 @@
    int fixed_slots = C->fixed_slots();
    OptoReg::Name begin_in_preserve = OptoReg::add(_matcher._old_SP, -(int)C->in_preserve_stack_slots());
    OptoReg::Name return_addr = _matcher.return_addr();
  
    reg = OptoReg::add(reg, -1);
+ 
+   // Special fixed slots
+   int current_slot = fixed_slots;
+   int stack_increment_slot = -1;
+   int nm_slot = -1;
+ 
+   auto next_slot = [&]() {
+     current_slot -= VMRegImpl::slots_per_word;
+     return current_slot;
+   };
+ 
+   if (C->needs_stack_repair()) {
+     stack_increment_slot = next_slot();
+   }
+   if (C->needs_nm_slot()) {
+     nm_slot = next_slot();
+   }
+   int orig_pc_slot = next_slot();
+ 
    while (OptoReg::is_stack(reg)) {
+     int stack_slot = (int)OptoReg::reg2stack(reg);
      tty->print("#r%3.3d %s+%2d: ",reg,fp,reg2offset_unchecked(reg));
      if (return_addr == reg) {
        tty->print_cr("return address");
      } else if (reg >= begin_in_preserve) {
        // Preserved slots are present on x86

@@ -2474,12 +2494,21 @@
        else if (return_addr == OptoReg::add(reg, 2*VMRegImpl::slots_per_word) &&
                 VerifyStackAtCalls)
          tty->print_cr("<Majik cookie>   +VerifyStackAtCalls");
        else
          tty->print_cr("in_preserve");
-     } else if ((int)OptoReg::reg2stack(reg) < fixed_slots) {
-       tty->print_cr("Fixed slot %d", OptoReg::reg2stack(reg));
+     } else if (stack_slot < fixed_slots) {
+       tty->print("Fixed slot %d", OptoReg::reg2stack(reg));
+       if (stack_slot == stack_increment_slot) {
+         tty->print_cr(" (stack increment)");
+       } else if (stack_slot == nm_slot) {
+         tty->print_cr(" (null marker)");
+       } else if (stack_slot == orig_pc_slot) {
+         tty->print_cr(" (original deopt pc)");
+       } else {
+         tty->cr();
+       }
      } else {
        tty->print_cr("pad2, stack alignment");
      }
      reg = OptoReg::add(reg, -1);
    }

@@ -2609,24 +2638,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) {
+                   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");
+                     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) {
+                 } 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 >