code: private Node tryFoldInstanceof(Node n, Node left, Node right) {
      checkArgument(n.isInstanceOf());
  
      // TODO(johnlenz) Use type information if available to fold
      // instanceof.
      if (NodeUtil.isLiteralValue(left, true)
          && !mayHaveSideEffects(right)) {
  
        Node replacementNode = null;
  
        if (NodeUtil.isImmutableValue(left)) {
          // Non-object types are never instances.
          replacementNode = IR.falseNode();
        } else if (right.isName()
            && "Object".equals(right.getString())) {
          replacementNode = IR.trueNode();
        }
  
        if (replacementNode != null) {
          n.replaceWith(replacementNode);
          reportChangeToEnclosingScope(replacementNode);
          markFunctionsDeleted(n);
          return replacementNode;
        }
      }
  
      return n;
    }
docs: Try to fold {@code left instanceof right} into {@code true}
  or {@code false}.