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

Issue 2865843002: Use FileSystem to read files in SourceLoader and TranslateUri. (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

Use FileSystem to read files in SourceLoader and TranslateUri. This is a prerequisite for writing fast unit tests, as I would like to do while working on the incremental kernel driver. R=ahe@google.com, paulberry@google.com, sigmund@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/cc91d045149fe9eab81a1819b1aaf73fcc5b96f0

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -44 lines) Patch
M pkg/analyzer/lib/src/fasta/analyzer_loader.dart View 2 chunks +3 lines, -1 line 0 comments Download
M pkg/analyzer/lib/src/fasta/analyzer_target.dart View 2 chunks +3 lines, -1 line 0 comments Download
M pkg/analyzer_plugin/analyzer_plugin.iml View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/kernel/fasta_support.dart View 3 chunks +5 lines, -2 lines 0 comments Download
M pkg/front_end/lib/kernel_generator.dart View 2 chunks +5 lines, -4 lines 0 comments Download
M pkg/front_end/lib/src/fasta/compile_platform.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/compiler_context.dart View 2 chunks +3 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/fasta.dart View 4 chunks +12 lines, -10 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_target.dart View 4 chunks +8 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/source/source_loader.dart View 5 chunks +24 lines, -4 lines 3 comments Download
M pkg/front_end/lib/src/fasta/translate_uri.dart View 3 chunks +4 lines, -5 lines 0 comments Download
M pkg/front_end/test/fasta/testing/suite.dart View 3 chunks +5 lines, -2 lines 0 comments Download
M pkg/front_end/test/subpackage_relationships_test.dart View 3 chunks +3 lines, -0 lines 0 comments Download
M pkg/front_end/tool/fasta_perf.dart View 3 chunks +4 lines, -3 lines 0 comments Download
M pkg/kernel/test/closures/suite.dart View 3 chunks +5 lines, -3 lines 0 comments Download
M pkg/kernel/test/interpreter/suite.dart View 3 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
scheglov
3 years, 7 months ago (2017-05-06 05:30:05 UTC) #1
Paul Berry
lgtm
3 years, 7 months ago (2017-05-06 13:24:43 UTC) #2
scheglov
Committed patchset #1 (id:1) manually as cc91d045149fe9eab81a1819b1aaf73fcc5b96f0 (presubmit successful).
3 years, 7 months ago (2017-05-06 20:09:37 UTC) #4
ahe
https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta/source/source_loader.dart File pkg/front_end/lib/src/fasta/source/source_loader.dart (right): https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta/source/source_loader.dart#newcode91 pkg/front_end/lib/src/fasta/source/source_loader.dart:91: zeroTerminatedBytes.setRange(0, rawBytes.length, rawBytes); I'd appreciate if we can roll ...
3 years, 7 months ago (2017-05-08 10:06:14 UTC) #5
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta/source/source_loader.dart File pkg/front_end/lib/src/fasta/source/source_loader.dart (right): https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta/source/source_loader.dart#newcode91 pkg/front_end/lib/src/fasta/source/source_loader.dart:91: zeroTerminatedBytes.setRange(0, rawBytes.length, rawBytes); On 2017/05/08 10:06:14, ahe wrote: > ...
3 years, 7 months ago (2017-05-08 16:38:22 UTC) #6
scheglov
3 years, 7 months ago (2017-05-08 16:53:36 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta...
File pkg/front_end/lib/src/fasta/source/source_loader.dart (right):

https://codereview.chromium.org/2865843002/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/source/source_loader.dart:91:
zeroTerminatedBytes.setRange(0, rawBytes.length, rawBytes);
On 2017/05/08 16:38:22, Siggi Cherem (dart-lang) wrote:
> On 2017/05/08 10:06:14, ahe wrote:
> > I'd appreciate if we can roll this back until the API supports reading into
a
> a
> > byte list.
> 
> Another option: instead of adding an API to read into a list, we could extend
> the readAsBytes API to match scanner/io.dart#readBytesFromFile  (take an
> optional `ensureZeroTermination` boolean)
> 
> 
> > 
> > Copying bytes is expensive.
> 

Well, we could do this.
OTOH API bloating is not nice.

Powered by Google App Engine
This is Rietveld 408576698