Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

investigate why we need to resolve compilation units again #1

Closed
sigmundch opened this issue Nov 25, 2014 · 3 comments
Closed

investigate why we need to resolve compilation units again #1

sigmundch opened this issue Nov 25, 2014 · 3 comments
Assignees

Comments

@sigmundch
Copy link
Contributor

computeLibraryElement used to be enough to compute the resolved tree for anything reachable from a library. However, getResolvedCompilationUnit2 sometimes returns null. Doing resolveCompilationUnit returns the right thing, but seems like this might be running the resolver more than necessary.

@sigmundch sigmundch self-assigned this Nov 25, 2014
@sigmundch
Copy link
Contributor Author

It seems that resolveCompilationUnit will check the cache anyways. I've also tried doing getResolvedCompilationUnit first, and only call resolvedCompilationUnit when its null, but I am not noticing any changes in performance.

Also context.getLibraryElement(source).definitingCompilationUnit.node seems similar too.

@vsmenon
Copy link
Contributor

vsmenon commented Jan 14, 2015

Is this still open?

@sigmundch
Copy link
Contributor Author

Closed. We figured out what was happening here. Basically it was an issue around caching and the cache size. When elements are evicted from the cache, getResolvedCompilationUnit returns null, even if it was previously computed. computeLibraryElement will check the cache too, and only recompute as needed.

vsmenon added a commit that referenced this issue Dec 1, 2015
Handles fields on "extension" types

See patch #1 for the test without the fix.

[email protected]

Review URL: https://codereview.chromium.org/1492523004 .
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants