Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Issue 1696193003: Fix cache corruption in incremental resolver (Closed)

Created:
4 years, 10 months ago by skybrian
Modified:
4 years, 10 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix cache corruption in incremental resolver - Add an element Modifier indicating that it's a cache key. - Don't allow the hashCode to change while it's in the cache. - Add code in the incremental resolver to remove the cache entry first if the hashCode will change. Also, there appears to be a memory leak in AnalysisCache where CacheEntry.dispose() was not usually called, so I also fixed that. BUG= R=brianwilkerson@google.com Committed: https://github.com/dart-lang/sdk/commit/6715573c6eb5e5a3c2b8257fef02e88a7d707d9f

Patch Set 1 #

Total comments: 12

Patch Set 2 : post-review cleanup #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -31 lines) Patch
M pkg/analyzer/lib/src/context/cache.dart View 1 7 chunks +22 lines, -6 lines 3 comments Download
M pkg/analyzer/lib/src/dart/element/element.dart View 1 7 chunks +65 lines, -7 lines 0 comments Download
M pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart View 1 2 chunks +8 lines, -3 lines 0 comments Download
M pkg/analyzer/lib/src/generated/incremental_resolver.dart View 1 2 chunks +6 lines, -4 lines 0 comments Download
M pkg/analyzer/test/enum_test.dart View 1 chunk +2 lines, -1 line 0 comments Download
M pkg/analyzer/test/generated/incremental_resolver_test.dart View 1 7 chunks +48 lines, -9 lines 0 comments Download
M pkg/analyzer/test/src/summary/resynthesize_test.dart View 1 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 13 (2 generated)
skybrian
https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart#newcode321 pkg/analyzer/lib/src/context/cache.dart:321: (target as ElementImpl).setModifier(Modifier.CACHE_KEY, true); Since target is a field, ...
4 years, 10 months ago (2016-02-16 07:11:06 UTC) #1
skybrian
This is not ready to check in but what do you think of the approach?
4 years, 10 months ago (2016-02-16 07:12:19 UTC) #3
Brian Wilkerson
The approach seems reasonable to me. https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart#newcode244 pkg/analyzer/lib/src/context/cache.dart:244: var entry = ...
4 years, 10 months ago (2016-02-16 15:10:48 UTC) #4
skybrian
https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/1/pkg/analyzer/lib/src/context/cache.dart#newcode244 pkg/analyzer/lib/src/context/cache.dart:244: var entry = partition.remove(target); On 2016/02/16 15:10:48, Brian Wilkerson ...
4 years, 10 months ago (2016-02-17 01:23:41 UTC) #5
skybrian
Would you please take another look?
4 years, 10 months ago (2016-02-17 02:03:39 UTC) #6
scheglov
https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart#newcode11 pkg/analyzer/lib/src/context/cache.dart:11: show ElementImpl, Modifier; Do we want to introduce Element ...
4 years, 10 months ago (2016-02-17 02:34:26 UTC) #7
skybrian
https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart#newcode11 pkg/analyzer/lib/src/context/cache.dart:11: show ElementImpl, Modifier; On 2016/02/17 02:34:25, scheglov wrote: > ...
4 years, 10 months ago (2016-02-17 03:05:57 UTC) #8
Brian Wilkerson
https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart File pkg/analyzer/lib/src/context/cache.dart (right): https://codereview.chromium.org/1696193003/diff/20001/pkg/analyzer/lib/src/context/cache.dart#newcode11 pkg/analyzer/lib/src/context/cache.dart:11: show ElementImpl, Modifier; > I consider this a temporary ...
4 years, 10 months ago (2016-02-17 04:03:54 UTC) #9
skybrian
Should I spend time looking into another solution (which will probably involve refactoring), or is ...
4 years, 10 months ago (2016-02-17 18:15:05 UTC) #10
Brian Wilkerson
I think the preferred approach will probably take too long and we should go ahead ...
4 years, 10 months ago (2016-02-17 22:51:45 UTC) #11
skybrian
4 years, 10 months ago (2016-02-19 02:29:47 UTC) #13
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
6715573c6eb5e5a3c2b8257fef02e88a7d707d9f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698