Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257197

Add additional verification code to PhaseCCP

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 21
    • 16, 17
    • hotspot
    • b02

      We should catch problems like JDK-8257166 during CCP by adding some verification code:

      @@ -1717,11 +1717,13 @@ void PhaseCCP::analyze() {
         // Push root onto worklist
         Unique_Node_List worklist;
         worklist.push(C->root());
      + DEBUG_ONLY(Unique_Node_List worklist_verify;)
       
         // Pull from worklist; compute new value; push changes out.
         // This loop is the meat of CCP.
         while( worklist.size() ) {
           Node *n = worklist.pop();
      + DEBUG_ONLY(worklist_verify.push(n);)
           const Type *t = n->Value(this);
           if (t != type(n)) {
             assert(ccp_type_widens(t, type(n)), "ccp type must widen");
      @@ -1813,6 +1815,21 @@ void PhaseCCP::analyze() {
             }
           }
         }
      +#ifdef ASSERT
      + while (worklist_verify.size()) {
      + Node* n = worklist_verify.pop();
      + const Type* told = type(n);
      + const Type* tnew = n->Value(this);
      + if (told != tnew) {
      + told->dump_on(tty);
      + tty->print_cr("");
      + tnew->dump_on(tty);
      + tty->print_cr("");
      + n->dump(1);
      + fatal("missed optimization opportunity");
      + }
      + }
      +#endif
       }

            epeter Emanuel Peter
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: