code: private static int spinsFor(Node pred, boolean haveData) {
          if (MP && pred != null) {
              if (pred.isData != haveData)      // phase change
                  return FRONT_SPINS + CHAINED_SPINS;
              if (pred.isMatched())             // probably at front
                  return FRONT_SPINS;
              if (pred.waiter == null)          // pred apparently spinning
                  return CHAINED_SPINS;
          }
          return 0;
      }
docs: Returns spin/yield value for a node with given predecessor and
  data mode. See above for explanation.