anchor.diff:     * analysis context, so at some point the unit might become resolved.
      */
     CompilationUnit get unit {
  -    AnalysisErrorListener errorListener = AnalysisErrorListener.NULL_LISTENER;
  -
  -    CharSequenceReader reader = new CharSequenceReader(content);
  -    Scanner scanner = new Scanner(source, reader, errorListener);
  -    scanner.scanGenericMethodComments = driver._analysisOptions.strongMode;
  -    Token token = scanner.tokenize();
  -    LineInfo lineInfo = new LineInfo(scanner.lineStarts);
  -
  -    Parser parser = new Parser(source, errorListener);
  -    parser.parseGenericMethodComments = driver._analysisOptions.strongMode;
  -    _unit = parser.parseCompilationUnit(token);
  -    _unit.lineInfo = lineInfo;
  -
  +    if (_unit == null) {
  +      AnalysisErrorListener errorListener = AnalysisErrorListener.NULL_LISTENER;
  +
  +      CharSequenceReader reader = new CharSequenceReader(content);
  +      Scanner scanner = new Scanner(source, reader, errorListener);
  +      scanner.scanGenericMethodComments = driver._analysisOptions.strongMode;
  +      Token token = scanner.tokenize();
  +      LineInfo lineInfo = new LineInfo(scanner.lineStarts);
  +
  +      Parser parser = new Parser(source, errorListener);
  +      parser.parseGenericMethodComments = driver._analysisOptions.strongMode;
  +      _unit = parser.parseCompilationUnit(token);
  +      _unit.lineInfo = lineInfo;
  +    }
       return _unit;
  +  }
  +
  +  /**
  +   * Return the unlinked bundle for the current file state.
  +   *
  +   * If the file [contentHash] is cached, try to load the bundle with this
  +   * hash. Otherwise, read the content, compute the new hash and try to find
  +   * the existing bundle, or parse the content and compute a new bundle.
  +   */
  +  PackageBundle get unlinked {
  +    String key = '$contentHash.unlinked';
  +    List<int> bytes = driver._byteStore.get(key);
  +    if (bytes == null) {
  +      driver._logger.run('Create unlinked for $this', () {
  +        UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit);
  +        PackageBundleAssembler assembler = new PackageBundleAssembler();
  +        assembler.addUnlinkedUnitWithHash(
  +            uri.toString(), unlinkedUnit, contentHash);
  +        bytes = assembler.assemble().toBuffer();
  +        driver._byteStore.put(key, bytes);
  +      });
  +    }
  +    return new PackageBundle.fromBuffer(bytes);
     }
   
     Uri get uri => source.uri;
  
positive.code:           // Append the defining unit.
            _ReferencedUris referenced;
            {
              PackageBundle bundle = _getUnlinked(libraryFile);
              UnlinkedUnit unlinked = bundle.unlinkedUnits.single;
              referenced = new _ReferencedUris(unlinked);
              node.unlinkedBundles.add(bundle);
  
negative.code:     return _logger.run('Compute analysis result for $file', () {
        _LibraryContext libraryContext = _createLibraryContext(file);
        AnalysisContext analysisContext = _createAnalysisContext(libraryContext);
        try {
          analysisContext.setContents(file.source, file.content);
          // TODO(scheglov) Add support for parts.
          CompilationUnit resolvedUnit =
              analysisContext.resolveCompilationUnit2(file.source, file.source);
          List<AnalysisError> errors = analysisContext.computeErrors(file.source);
          return new AnalysisResult(file.path, file.uri, file.content,
              file.contentHash, resolvedUnit, errors);
        } finally {
          analysisContext.dispose();
        }
      });
    }
  
  