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

Issue 2378063002: Remove Enqueuer argument from Backend.registerStaticUse (Closed)

Created:
4 years, 2 months ago by Johnni Winther
Modified:
4 years, 2 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Remove Enqueuer argument from Backend.registerStaticUse - and from CustomElementsAnalysis, TypeVariableHandler, and LookupMapAnalysis methods R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/ead7f7030afbb7e1fdc8e6fe1679f89bcc4ff6fe

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Renamed onQueueEmpty to flush. #

Patch Set 4 : Add more. #

Total comments: 10

Patch Set 5 : Updated cf. comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -39 lines) Patch
M pkg/compiler/lib/src/common/backend_api.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/enqueue.dart View 1 2 3 4 3 chunks +8 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 2 3 5 chunks +12 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart View 1 2 6 chunks +15 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/enqueuer.dart View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/type_variable_handler.dart View 1 2 3 1 chunk +5 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (4 generated)
Johnni Winther
4 years, 2 months ago (2016-09-29 08:17:17 UTC) #3
Siggi Cherem (dart-lang)
lgtm, with one small suggestion, and a few general questions about what to do with ...
4 years, 2 months ago (2016-09-29 18:04:44 UTC) #5
Johnni Winther
Committed patchset #5 (id:80001) manually as ead7f7030afbb7e1fdc8e6fe1679f89bcc4ff6fe (presubmit successful).
4 years, 2 months ago (2016-09-30 08:26:13 UTC) #7
Johnni Winther
4 years, 2 months ago (2016-09-30 08:27:03 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/en...
File pkg/compiler/lib/src/enqueue.dart (right):

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/en...
pkg/compiler/lib/src/enqueue.dart:115: /// the impact strategy will remove it
from the element impact cache, if it is
On 2016/09/29 18:04:43, Siggi Cherem (dart-lang) wrote:
> a few questions here...
> 
> 1. other than reducing memory-use, any other reason we need to clear the cache
> one by one?
> 
> 2. any reason we have the impact-strategy in the backend? it seems that the
> strategy there is pretty general and not JS specific.
> 
> 3. are we gaining much from having the impact-strategy abstraction? It appears
> that we mainly use it to decide how we deal with caching, so I'm wondering if
> things would get simpler if we deal with caching directly.

1. For memory-use.
2. It was (or is) planned to skip application of previously applied
BackendImpacts when we don't need deferred or dart2js-info, but has not been
implemented (yet).
3. Since we no longer need to support multiple targets we could inline the
reasoning.

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/en...
pkg/compiler/lib/src/enqueue.dart:117: void applyImpact(WorldImpact worldImpact,
{Element forElement});
On 2016/09/29 18:04:43, Siggi Cherem (dart-lang) wrote:
> nit: rename "forElement" to "impactSource"?

Done.

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/js...
File pkg/compiler/lib/src/js_backend/backend.dart (right):

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/js...
pkg/compiler/lib/src/js_backend/backend.dart:3219: if (impactUse ==
ResolutionEnqueuer.IMPACT_USE) {
On 2016/09/29 18:04:43, Siggi Cherem (dart-lang) wrote:
> unrelated to this CL, but related comment to the impact-strategy:
> 
> consider renaming *.IMPACT_USE: since so many impacts are about uses
> "static-use", "type-use", "impact-use" sounds like an impact itself :-)
> 
> Some ideas:
> - rename impactUse => useCase. 
> - move the constant to ImpactUseCase.RESOLUTION
> 
> if (useCase == ImpactUseCase.RESOLUTION) { ... }

Acknowledged.

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/js...
pkg/compiler/lib/src/js_backend/backend.dart:3221: impact.apply(visitor);
On 2016/09/29 18:04:43, Siggi Cherem (dart-lang) wrote:
> unrelated nit: since you intend to call apply on every branch, consider
> refactoring it to just do that upfront. For example:
> 
>   visitImpact(...) {
>     impact.apply(visitor);
>     if (useCase == ImpactUseCase.RESOLUTION && !supportDeferredLoad &&
> !supportSerialization && element != null) {
>       resolution.uncacheWorldImpact(element);
>     }
>     if (useCase == ImpactUseCase.DUMP_INFO) {
>       dumpInfoTask.unregisterImpact(element);
>     }
>   }
> 

Acknowledged.

https://codereview.chromium.org/2378063002/diff/60001/pkg/compiler/lib/src/js...
pkg/compiler/lib/src/js_backend/backend.dart:3225:
resolution.uncacheWorldImpact(element);
On 2016/09/29 18:04:43, Siggi Cherem (dart-lang) wrote:
> related to the question earlier about getting rid of impact-strategy. I was
> looking more closely at where we do something special about caching, and I'm
> more and more inclined to move the logic directly to those places and remove
the
> strategy abstraction.
> 
> That would mean that the resolution enqueuer would directly clear it's cache,
so
> instead of:
> 
>    compiler.impactStrategy
>        .visitImpact(element, worldImpact, impactVisitor, impactUse);
> 
> we'd have:
> 
>    worldImpact.apply(impactVisitor);
>    if (!supportDeferredLoad && !supportSerialization && element != null) {
>      resolution.uncacheWorldImpact(element);
>    }
> 
> 
> this also means that ImpactUseCase might disappear.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698