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

Issue 1924053003: Serialize more properties of ConstructorElement. (Closed)

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

Description

Serialize more properties of ConstructorElement. Committed: https://github.com/dart-lang/sdk/commit/4c563fecbf0be73d2d1df5bd005bca415a9065eb

Patch Set 1 #

Patch Set 2 : dartfmt #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -22 lines) Patch
M pkg/compiler/lib/src/serialization/element_serialization.dart View 1 5 chunks +35 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/serialization/keys.dart View 3 chunks +6 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/serialization/modelz.dart View 1 6 chunks +83 lines, -20 lines 3 comments Download
M tests/compiler/dart2js/serialization_test.dart View 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Johnni Winther
4 years, 7 months ago (2016-04-29 06:56:18 UTC) #2
Johnni Winther
TBR (needed to land https://codereview.chromium.org/1927963002/ but I forgot to publish it yesterday)
4 years, 7 months ago (2016-04-29 07:59:54 UTC) #3
Johnni Winther
Committed patchset #2 (id:20001) manually as 4c563fecbf0be73d2d1df5bd005bca415a9065eb (presubmit successful).
4 years, 7 months ago (2016-04-29 08:01:02 UTC) #5
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/serialization/modelz.dart File pkg/compiler/lib/src/serialization/modelz.dart (right): https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/serialization/modelz.dart#newcode1218 pkg/compiler/lib/src/serialization/modelz.dart:1218: ConstructorElement get immediateRedirectionTarget { optional suggestion, probably not ...
4 years, 7 months ago (2016-04-29 20:20:23 UTC) #6
Johnni Winther
https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/serialization/modelz.dart File pkg/compiler/lib/src/serialization/modelz.dart (right): https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/serialization/modelz.dart#newcode1218 pkg/compiler/lib/src/serialization/modelz.dart:1218: ConstructorElement get immediateRedirectionTarget { On 2016/04/29 20:20:23, Siggi Cherem ...
4 years, 7 months ago (2016-04-30 09:04:46 UTC) #7
Siggi Cherem (dart-lang)
4 years, 7 months ago (2016-05-02 16:58:35 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/se...
File pkg/compiler/lib/src/serialization/modelz.dart (right):

https://codereview.chromium.org/1924053003/diff/20001/pkg/compiler/lib/src/se...
pkg/compiler/lib/src/serialization/modelz.dart:1218: ConstructorElement get
immediateRedirectionTarget {
On 2016/04/30 09:04:46, Johnni Winther wrote:
> On 2016/04/29 20:20:23, Siggi Cherem (dart-lang) wrote:
> > optional suggestion, probably not worth it.
> > 
> > I'd either initialize them everything we can upfront in the constructor. Any
> > lazy field, I'd prefer to initialize on its own if that's possible. 
> 
> 
> I think it's only really worthwhile to deserialize everything in the
constructor
> if we can free the [_decoder] and more importantly the object from which it
> reads its data. With the current setup it is not directly possible but we need
> to look into it when we focus on the serialization format.
> 

Yeah, I look forward to the new format. At that point we'll likely initialize
everything upfront: looking at Asger's numbers for the time spent loading data,
I expect it will be fast enough that it wont be worth making it lazy.

> > For example
> > these 2 redirection targets are technically always used together, but they
> could
> > easily be initialized each on their first use. 
> > 
> > ConstructorElement get immediateRedirectionTarget =>
> >     __immediateRedirectionTarget ??=
> > decoder.getElement(Key.IMMEDIATE_REDIRECTION_TARGET);
> > 
> > ConstructorElement get redirectionDeferredPRefix =>
> >     __immediateRedirectionTarget ??= decoder.getElement(Key.PREFIX, ...);
> > 
> 
> Since [_redirectionDeferredPrefix] might be `null` ??= would make us decode on
> each access. This is why I grouped it with [immediateRedirectionTarget].
> 
> > 
> > 
> > I think we can do something similar with effectiveTarget/Type, but again,
> might
> > not be worth it.
> 
> 

Ah, I see. Maybe we should consider initializing in constructors anything we
that says `isOptional`.

Powered by Google App Engine
This is Rietveld 408576698