Commit Graph

4770 Commits

Author SHA1 Message Date
Konstantin Shcheglov 39b921ecce Transitively include outlines of all public members of Class(es).
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3004943002 .
2017-08-31 11:35:08 -07:00
Peter von der Ahé 24ec5691d0 Don't re-export hidden members.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004123002 .
2017-08-31 16:45:18 +02:00
Peter von der Ahé f0277b32e8 Revert "Store actual Reference(s) for additional exports."
This reverts commit 234c4a7f49.

Revert "Fix for ScopeBuilder[] - look into setters too."

This reverts commit 7924f4c42f.

Revert "Don't include BuiltinTypeBuilder(s) into additional exports."

This reverts commit e28aac09c4.

The reason for reverting is that the two follow-up commits aren't correct.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004973002 .
2017-08-31 16:13:50 +02:00
Dan Rubel 5f5386b404 improve recovery of invalid top level abstract modifier usage
The fasta parser now gracefully degrades if the user puts 'abstract' before a top level declaration other than 'class'.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/3010713002 .
2017-08-31 07:28:42 -04:00
Paul Berry b8e5e03ff4 Remove ShadowVariableDeclaration.isSemiSafe.
This only existed as a temporary measure while we were discussing how
to modify the kernel format.  It has been replaced by
VariableDeclaration.formalSafety.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3009883002 .
2017-08-30 17:38:30 -04:00
Paul Berry a5b3cbac13 Rename front end shadow classes from "Kernel..." to "Shadow...".
This should reduce confusion, since these classes are specifically
*not* part of kernel.  I also went ahead and renamed a few classes
that aren't shadow classes but are related to the shadow classes,
e.g. KernelTypeInferrer -> ShadowTypeInferrer.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3004923002 .
2017-08-30 13:10:25 -07:00
Konstantin Shcheglov e28aac09c4 Don't include BuiltinTypeBuilder(s) into additional exports.
Their `target` fails.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3004093002 .
2017-08-30 12:48:57 -07:00
Paul Berry c3ae6bd296 Simplify annotations in runtime check tests.
It turns out that it is easier to calculate whether or not checks are
needed at the site of the declaration of the interface target, not at
the call site.  Accordingly, it makes sense to put the annotations on
the interface target declarations as well.  This lets us get rid of a
clumsy annotation format that referred to arguments by number, in
favor of simply annotating the formal parameters themselves.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3010613003 .
2017-08-30 11:05:16 -07:00
Konstantin Shcheglov 288b203b6c Stop building export scopes in KernelDriver.
Fasta already store exports scopes into Kernel.
It was added some time ago and improved recently.
https://github.com/dart-lang/sdk/commit/234c4a7f493e1fc3dafc393472e39163ac2ad783

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3004913002 .
2017-08-30 10:38:17 -07:00
Konstantin Shcheglov 7924f4c42f Fix for ScopeBuilder[] - look into setters too.
TBR

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3010763002 .
2017-08-30 10:32:35 -07:00
Konstantin Shcheglov 234c4a7f49 Store actual Reference(s) for additional exports.
We need this to be able to tree shake outline.
https://github.com/dart-lang/sdk/issues/30448#issuecomment-325434406

R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3008763002 .
2017-08-30 09:56:21 -07:00
Konstantin Shcheglov 5d07433bb1 Mark types of Constructor parameters and preserve referenced typedefs.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3009803002 .
2017-08-29 16:52:51 -07:00
Sigmund Cherem 1a2870f798 Remove check for scheme in source-loader.
Context: this prevents us from using other schemes in unit tests, and causes
issues when processign a URI with no scheme, that happens to be supported by the
underlying file-system (e.g. PhysicalFileSystem will make it a `file:*` URI if
no scheme was present).

This is necessary to fix dartbug.com/30141

R=ahe@google.com

Committed: https://github.com/dart-lang/sdk/commit/d9ae60e14fdec52bda977ed114f6ad70dc2f0bc4
Review-Url: https://codereview.chromium.org/3006483002 .
2017-08-29 11:35:15 -07:00
Dan Rubel 059e877d23 report abstract as extraneous modifier
R=ahe@google.com

Review-Url: https://codereview.chromium.org/3004683002 .
2017-08-29 11:00:35 -04:00
Peter von der Ahé 48503c8720 Don't export unnamed mixins.
Fixes https://github.com/dart-lang/sdk/issues/30553

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3004703002 .
2017-08-29 16:33:33 +02:00
Peter von der Ahé 37d3c369d8 Start trying to compile platform from unpatched sources.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3009503002 .
2017-08-29 16:09:24 +02:00
danrubel a816484b59 tweak fasta parser event debug code
R=ahe@google.com

Review-Url: https://codereview.chromium.org/3002323002 .
2017-08-29 09:10:47 -04:00
Dan Rubel 2d449c870f flatten token hierarchy
This merges functionality and removes several Token classes
making the Token hierarchy more compact.

* merge BeginTokenWithComment into BeginToken
* merge KeywordTokenWithComment into KeywordToken
* merge StringTokenWithComment into StringToken
* merge TokenWithComment into SimpleToken

R=ahe@google.com

Review-Url: https://codereview.chromium.org/3010533002 .
2017-08-29 08:59:16 -04:00
Peter von der Ahé a5bcf58b06 Move tools to tool folder.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3003743002 .
2017-08-29 14:30:51 +02:00
Peter von der Ahé 6eff945874 Mark top-level error field as static.
Closes https://github.com/dart-lang/sdk/issues/30431

R=sjindel@google.com

Review-Url: https://codereview.chromium.org/2999033002 .
2017-08-29 12:39:00 +02:00
Peter von der Ahé f60a6af7c1 Make internalFormat more robust.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2999963002 .
2017-08-29 11:46:15 +02:00
Peter von der Ahé 1b5cbc7694 Add debug names to scopes.
R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2995023002 .
2017-08-29 11:19:50 +02:00
Peter von der Ahé c89fb50056 Fix issues from CL 3009573002.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3003993002 .
2017-08-28 13:51:52 +02:00
Jens Johansen 1ad24e4b46 [kernel] Add offset to SwitchContinueStatement; add debugging test
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004693002 .
2017-08-28 12:01:03 +02:00
Konstantin Shcheglov a751b971a2 Remember direct dependencies in LibraryCycle.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3009683002 .
2017-08-26 14:50:37 -07:00
Konstantin Shcheglov f78d43c3d3 Convert GeneratedContent to async and use AnalysisDriver for tasks graph.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3002293003 .
2017-08-26 07:51:34 -07:00
Dan Rubel 8786656783 map fasta error codes to analyzer
Rather than have multple fine grained error codes for each type
of modifier in each situation, this CL adds a new analyzer
ParserErrorCode.EXTRANEOUS_MODIFIER parallel to the fast parser
error code and updates the AstBuilder to generate that error
rather than ParserErrorCode.ABSTRACT_CLASS_MEMBER.

My goal is to review each analyzer error code similar to
ParserErrorCode.ABSTRACT_CLASS_MEMBER and map each to the same
ParserErrorCode.EXTRANEOUS_MODIFIER error code.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2999303002 .
2017-08-25 09:00:18 -04:00
Dan Rubel 07a00fc258 remove old fasta missing exponent recovery
As of https://codereview.chromium.org/3002493003
fasta recovers from a missing exponent by
first issuing an error and then appending '0' to the number
so that 347e becomes 347e0

This CL removes the old error recovery that appends NaN
to the token stream as it is no longer needed.

Fix https://github.com/dart-lang/sdk/issues/30508

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3004573002 .
2017-08-25 08:57:24 -04:00
Jens Johansen 2ba6cce387 [kernel] Position on switch expression
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/3003863002 .
2017-08-25 13:54:40 +02:00
Peter von der Ahé aff5d768d7 Serialize exports scopes.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3009573002 .
2017-08-25 13:54:13 +02:00
Sigmund Cherem 752df5edb9 Revert "Remove check for scheme in source-loader."
This triggered some failures on the vm bots, I'll hopefully reland tomorrow morning.

This reverts commit d9ae60e14f.

R=ahe@googl.com
CC=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3005573002 .
2017-08-24 21:40:43 -07:00
Sigmund Cherem d9ae60e14f Remove check for scheme in source-loader.
Context: this prevents us from using other schemes in unit tests, and causes
issues when processign a URI with no scheme, that happens to be supported by the
underlying file-system (e.g. PhysicalFileSystem will make it a `file:*` URI if
no scheme was present).

This is necessary to fix dartbug.com/30141

Review-Url: https://codereview.chromium.org/3006483002 .
2017-08-24 16:24:34 -07:00
Konstantin Shcheglov 6d5a29004c Generalize LRU Cache to any objects.
It turned out that caching just bytes does not allow us to realize full
benefits of caching PackageBundle(s). We want to keep partially
decoded values like sub-objects and strings for maximum performance.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2998363002 .
2017-08-24 11:07:07 -07:00
Konstantin Shcheglov 827075befb Store the covariant keyword flag for parameters and fields into Kernel and resynthesize in analyzer.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3008463002 .
2017-08-24 07:17:36 -07:00
Sigmund Cherem f539785e03 Load extraRequiredLibraries from the target passed in the options
This makes the behavior match what fasta does.

Long term I agree we don't want these implicit imports. I sent an email to
brainstorm a solution for that.

This change will address one of the issues reported in http://dartbug.com/30491

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3007503002 .
2017-08-23 20:11:53 -07:00
Paul Berry f6e2676571 Properly annotate the checks needed when invoking function-typed objects.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2999403003 .
2017-08-23 13:49:14 -07:00
Konstantin Shcheglov dab5318fad Clear StringToken.canonicalizer after each parsing.
Otherwise the canonicalizer grows without limit, and if the user
edits files, we constantly parse new strings, so constantly add new
entries into the cananonicalizer. Basically, it is not friendly for
long running processes. I'm not quite sure why we need to makes it
static anyway, if it can be used only for the same file content. Once
we're done with a file, that is it, we don't need its entries.

Anyway, this fixes a leak in Analysis Server.

R=ahe@google.com, brianwilkerson@google.com, danrubel@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3003753002 .
2017-08-23 10:57:27 -07:00
Paul Berry 6e842b3c11 Start implementing logic for determining when formal parameters need type checks.
We haven't quite figured out how we want to store the need for these
type checks in the kernel representation, and I'm hoping that my
coding work can help inform that decision.  So for the moment the
annotation is simply stored in the front_end wrapper
(KernelVariableDeclaration).  This is enough to get simple tests to
pass.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/3000353002 .
2017-08-23 10:17:54 -07:00
Dan Rubel 69e9106ead improve fasta export directive recovery
R=ahe@google.com

Review-Url: https://codereview.chromium.org/3001993002 .
2017-08-22 16:52:23 -04:00
Dan Rubel d1385f099f support class native clause
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2996163002 .
2017-08-22 07:42:56 -04:00
Paul Berry 247f20b581 Begin writing tests of the runtime checks needed for Dart 2.0 soundness.
The tests in this CL illustrate the major use cases where runtime
checks are required.  They are not exhaustive.  In a later CL I will
copy over some of analyzer's internal unit tests, which are much more
thorough.

So far these tests only pass when tested via analyzer, since analyzer
currently is the only platform that does the necessary analysis to
figure out which checks are needed.  In follow up CLs I will begin
introducing code into front_end to determine which checks are needed,
and to record this information in the kernel representation.

R=danrubel@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/3002893002 .
2017-08-20 22:28:36 -07:00
Dan Rubel 6a958b3edb refactor AstBuilder
Refactor the AstBuilder to use scriptTag, directives, and declarations
fields rather than pushing top level nodes on a generic stack
and later popping and sorting objects from the that generic stack.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2995963002 .
2017-08-16 09:47:27 -04:00
Dan Rubel aefd73b8d3 new handleInvalidTopLevelDeclaration event in fasta parser
This adds a new event for better fasta parser recovery
when the parser detects an invalid character at the top level.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2985703002 .
2017-08-16 09:36:24 -04:00
Paul Berry 19e1f44be3 Fix logic for locating dartfmt
When dartfmt is run as part of tests to verify that code generation is
up to date, the directory containing the resolved executable is
sometimes .../out/Release.../, but dartfmt is located in
.../out/Release.../dart-sdk/bin/dartfmt.  So we need to look in both
the resolved executable directory and in dart-sdk/bin for dartfmt.

R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/3002713002 .
2017-08-15 13:32:30 -07:00
Dan Rubel edc043a83b move endMetadataStar
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2998933002 .
2017-08-15 13:48:59 -04:00
Peter von der Ahé 07cf2557ed Implement type variables on local function declarations and expressions.
Closes https://github.com/dart-lang/sdk/issues/29798

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2994973002 .
2017-08-15 11:21:01 +02:00
Alexander Markov f40ce90eaa [fasta] Issue error for large integer literals
This CL adds error reporting for large integer literals into the
new kernel front-end. It is a part of preparation for limiting
integers to 64 bits in Dart. The new error is reported only
if int.parse() fails to parse integer literal, which could happen
in the --limit-ints-to-64-bits mode.

R=ahe@google.com, scheglov@google.com, sigmund@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2989073002 .
2017-08-14 11:08:40 -07:00
Dan Rubel 63991ba171 generate synthetic and error tokens when missing digit
Fix #30321

R=ahe@google.com

Review-Url: https://codereview.chromium.org/3002493002 .
2017-08-14 09:09:40 -04:00
Dan Rubel 02ce510601 translate missing ">" fasta error code to analyzer error
Fix #30320

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2996673002 .
2017-08-11 15:29:49 -04:00
Konstantin Shcheglov eb3c3d8f77 Extract BytesMemoryCache from MemoryCachingByteStore.
BytesMemoryCache will be used in Bazel workers to cache values of
inputs by their digest, so avoid reading the same files multiple times.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3000723002 .
2017-08-11 12:25:29 -07:00