previousGraphs = getPreviousGraphs(previousGraphs, compiledViewDefinition);
if ((compiledViewDefinition.getPortfolio() != null) && invalidIdentifiers.containsKey(compiledViewDefinition.getPortfolio().getUniqueId())) {
// The portfolio resolution is different, invalidate or rewrite PORTFOLIO and PORTFOLIO_NODE nodes in the graph. Note that incremental
// compilation under this circumstance can be flawed if the functions have made notable use of the overall portfolio structure such that
// a full re-compilation will yield a different dependency graph to just rewriting the previous one.
final ComputationTargetResolver resolver = getProcessContext().getFunctionCompilationService().getFunctionCompilationContext().getRawComputationTargetResolver();
final ComputationTargetSpecification portfolioSpec = resolver.getSpecificationResolver().getTargetSpecification(
new ComputationTargetSpecification(ComputationTargetType.PORTFOLIO, getViewDefinition().getPortfolioId()), versionCorrection);
final ComputationTarget newPortfolio = resolver.resolve(portfolioSpec, versionCorrection);
unchangedNodes = rewritePortfolioNodes(previousGraphs, compiledViewDefinition, (Portfolio) newPortfolio.getValue());
}
// Invalidate any dependency graph nodes on the invalid targets
filterPreviousGraphs(previousGraphs, new InvalidTargetDependencyNodeFilter(invalidIdentifiers.keySet()), unchangedNodes);
previousResolutions = new ConcurrentHashMap<>(resolvedIdentifiers.size());