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

Issue 2874723002: Add a way to use shared CanonicalName root to deserialize Program. (Closed)

Created:
3 years, 7 months ago by scheglov
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add a way to use shared CanonicalName root to deserialize Program. This allows for example to add SDK into a Program, then load the "incomplete" Program A that has only the library A, and name sequences that references SDK classes. Because we look into the nameRoot which aleady has SDK CanonicalName(s), we can find these names while filling the link table and use references which point to the existing SDK AST nodes. Then we can load another set of library cycles, etc. At the end we have a set of self-consistent libraries that we can feed into DillTarget/DillLoader and resolve anothersource target against it. This CL is based on https://codereview.chromium.org/2872903005/ which has not been reviewed yet. R=kmillikin@google.com, paulberry@google.com, sigmund@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/bdedd6768b4f594a3034151ada169b058515542f

Patch Set 1 #

Patch Set 2 : Actual changes. #

Total comments: 4

Patch Set 3 : Always compute canonical names. Use shared name root. #

Total comments: 3

Patch Set 4 : Move 'nameRoot' into KernelTarget.link(). #

Total comments: 2

Patch Set 5 : Add TODO for 'uriToSource'. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -28 lines) Patch
M pkg/analysis_server/analysis_server.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/analyzer.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer_cli/analyzer_cli.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer_plugin/analyzer_plugin.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/kernel/task.dart View 1 1 chunk +2 lines, -1 line 1 comment Download
M pkg/front_end/front_end.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/dill/dill_loader.dart View 1 2 1 chunk +3 lines, -4 lines 1 comment Download
M pkg/front_end/lib/src/fasta/dill/dill_target.dart View 1 2 3 2 chunks +3 lines, -9 lines 0 comments Download
M pkg/front_end/lib/src/fasta/fasta.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_target.dart View 1 2 3 4 4 chunks +10 lines, -9 lines 1 comment Download
M pkg/front_end/test/fasta/testing/suite.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/lib/ast.dart View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M pkg/kernel/lib/testing/mock_sdk_program.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M pkg/kernel/test/closures/suite.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/test/interpreter/suite.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/test/type_subtype_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (2 generated)
scheglov
3 years, 7 months ago (2017-05-10 04:36:02 UTC) #1
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2874723002/diff/20001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2874723002/diff/20001/pkg/kernel/lib/ast.dart#newcode4219 pkg/kernel/lib/ast.dart:4219: final CanonicalName root; Question for Kevin on API design ...
3 years, 7 months ago (2017-05-10 18:00:38 UTC) #2
Kevin Millikin (Google)
I don't completely understand your use case. Is it possible to link all the binaries ...
3 years, 7 months ago (2017-05-11 08:22:55 UTC) #3
scheglov
PTAL https://codereview.chromium.org/2874723002/diff/20001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2874723002/diff/20001/pkg/kernel/lib/ast.dart#newcode4243 pkg/kernel/lib/ast.dart:4243: if (library.canonicalName != null) continue; On 2017/05/11 08:22:55, ...
3 years, 7 months ago (2017-05-11 18:31:25 UTC) #4
scheglov
Ping! On 2017/05/11 18:31:25, scheglov wrote: > PTAL > > https://codereview.chromium.org/2874723002/diff/20001/pkg/kernel/lib/ast.dart > File pkg/kernel/lib/ast.dart (right): ...
3 years, 7 months ago (2017-05-12 15:39:01 UTC) #5
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2874723002/diff/40001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart File pkg/front_end/lib/src/fasta/kernel/kernel_target.dart (right): https://codereview.chromium.org/2874723002/diff/40001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart#newcode382 pkg/front_end/lib/src/fasta/kernel/kernel_target.dart:382: nameRoot: dillTarget.nameRoot, I think I don't have the full ...
3 years, 7 months ago (2017-05-12 16:27:57 UTC) #6
scheglov
PTAL Please ignore the similar separate CL that was sent a minute ago. I accidentally ...
3 years, 7 months ago (2017-05-12 17:15:16 UTC) #7
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/2874723002/diff/60001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart File pkg/front_end/lib/src/fasta/kernel/kernel_target.dart (left): https://codereview.chromium.org/2874723002/diff/60001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart#oldcode378 pkg/front_end/lib/src/fasta/kernel/kernel_target.dart:378: uriToSource.addAll(binary.uriToSource); do we need to preserve this somehow? ...
3 years, 7 months ago (2017-05-12 17:29:25 UTC) #8
Siggi Cherem (dart-lang)
lgtm (Kevin - we are assuming that the API change Program was OK by you, ...
3 years, 7 months ago (2017-05-12 17:31:17 UTC) #9
scheglov
Committed patchset #5 (id:80001) manually as bdedd6768b4f594a3034151ada169b058515542f (presubmit successful).
3 years, 7 months ago (2017-05-12 17:42:15 UTC) #11
scheglov
https://codereview.chromium.org/2874723002/diff/60001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart File pkg/front_end/lib/src/fasta/kernel/kernel_target.dart (left): https://codereview.chromium.org/2874723002/diff/60001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart#oldcode378 pkg/front_end/lib/src/fasta/kernel/kernel_target.dart:378: uriToSource.addAll(binary.uriToSource); On 2017/05/12 17:29:25, Siggi Cherem (dart-lang) wrote: > ...
3 years, 7 months ago (2017-05-12 17:44:21 UTC) #12
sra1
https://codereview.chromium.org/2874723002/diff/80001/pkg/compiler/lib/src/kernel/task.dart File pkg/compiler/lib/src/kernel/task.dart (right): https://codereview.chromium.org/2874723002/diff/80001/pkg/compiler/lib/src/kernel/task.dart#newcode45 pkg/compiler/lib/src/kernel/task.dart:45: libraries: kernel.libraryDependencies(library.canonicalUri)) This turned one of the dart2js bots ...
3 years, 7 months ago (2017-05-12 23:07:45 UTC) #14
sra1
On 2017/05/12 23:07:45, sra1 wrote: > https://codereview.chromium.org/2874723002/diff/80001/pkg/compiler/lib/src/kernel/task.dart > File pkg/compiler/lib/src/kernel/task.dart (right): > > https://codereview.chromium.org/2874723002/diff/80001/pkg/compiler/lib/src/kernel/task.dart#newcode45 > ...
3 years, 7 months ago (2017-05-12 23:14:19 UTC) #15
Kevin Millikin (Google)
On 2017/05/12 17:31:17, Siggi Cherem (dart-lang) wrote: > lgtm > > (Kevin - we are ...
3 years, 7 months ago (2017-05-15 08:47:56 UTC) #16
ahe
3 years, 7 months ago (2017-05-15 09:08:44 UTC) #17
Message was sent while issue was closed.
Why wasn't I CC'ed on this review?

https://codereview.chromium.org/2874723002/diff/80001/pkg/front_end/lib/src/f...
File pkg/front_end/lib/src/fasta/dill/dill_loader.dart (right):

https://codereview.chromium.org/2874723002/diff/80001/pkg/front_end/lib/src/f...
pkg/front_end/lib/src/fasta/dill/dill_loader.dart:17: final libraries =
<Library>[];
Please add a type.

https://codereview.chromium.org/2874723002/diff/80001/pkg/front_end/lib/src/f...
File pkg/front_end/lib/src/fasta/kernel/kernel_target.dart (right):

https://codereview.chromium.org/2874723002/diff/80001/pkg/front_end/lib/src/f...
pkg/front_end/lib/src/fasta/kernel/kernel_target.dart:379: //   
uriToSource.addAll(binary.uriToSource);
Yes. You need to update uriToSource. Otherwise the created dill file lacks
source information.

Powered by Google App Engine
This is Rietveld 408576698