Commit Graph

7628 Commits

Author SHA1 Message Date
Dan Rubel 4eb4d75270 Remove unused event parameter
Change-Id: I097886cae93204d671a3aca4caaafea8d117989d
Reviewed-on: https://dart-review.googlesource.com/70180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 01:04:46 +00:00
Dan Rubel 825df975a0 Revise fasta type arg/param parsing to ignore "<".endGroup
The scanner associates '<' with '>' and '>>',
but the parser cannot use '<'.endToken/endGroup reliably
and wastes time updating that token's endToken/endGroup field.

This CL updates type info parsing to ignore '<'.endGroup
and step through the token stream (which it has to do anyway),
for improved parsing.

This CL causes a handful of existing tests to fail (marked as @failingTest)
and test failures will be addressed in a subsequent CL.

Change-Id: I788e9a74cd2891f98f44bba15d5669febfec6c64
Reviewed-on: https://dart-review.googlesource.com/70001
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 22:16:40 +00:00
Brian Wilkerson 0bcf767d4d Clean up more preview-dart-2 related code
Change-Id: Id1f81a635727f0f2fafb5dea4178f303c6ca4659
Reviewed-on: https://dart-review.googlesource.com/70143
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 14:43:12 +00:00
Brian Wilkerson 49437e3bae Split TooManyArguments to support quick fixes
Change-Id: I31511f619cafbce01f68d6e182328567a2bc3523
Reviewed-on: https://dart-review.googlesource.com/70021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:22 +00:00
Keerti Parthasarathy b99e41ac6f Revert "fix #28233, add hint for missing returns to function expressions"
This reverts commit 058510eeab.

This causes a lot of missing_return failures internally and requires time to fix.

Change-Id: I2c7a79c6e838bbd9f101f53919b1db2c0d4a2594
Reviewed-on: https://dart-review.googlesource.com/70024
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-08-14 21:10:27 +00:00
Paul Berry 75af21c363 Add wrapped versions of element classes.
These new classes are in lib/src to discourage them from being widely
used.  The intention is to use them in angular_analyzer_plugin, so
that it can extend the wrapper classes rather than implement the
element classes directly.  This will ensure that
angular_analyzer_plugin doesn't break when new methods are added to
element classes.

Change-Id: I33d82e4534691f546fcabc7b9d6c1da0258a5fc0
Reviewed-on: https://dart-review.googlesource.com/70020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-14 19:07:56 +00:00
Leaf Petersen 5a8afa76b1 Triage language tests for void in DDC and analyzer
Change-Id: Ib72fa4515ac29b66d90b237739f97219b98acda2
Reviewed-on: https://dart-review.googlesource.com/67282
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-08-14 17:42:43 +00:00
Devon Carew 6a4f1b76ac Remove the --preview-dart-2 option from dartanalyzer and the analysis server.
Change-Id: I268b9d5f79b30d0e4a0f8e6bb81a7738c98e5eea
Reviewed-on: https://dart-review.googlesource.com/69802
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-14 04:24:47 +00:00
Brian Wilkerson 5f4343f864 Remove the analyzer code from DuplicatedNamePreviouslyUsedCause
Change-Id: Ia605421652a045b282b856be1ecfe7bd086876d9
Reviewed-on: https://dart-review.googlesource.com/69801
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-13 22:37:27 +00:00
Devon Carew e2164fb292 Update the analyzer_cfe_progress.dart scrip to measure language_2 failures.
Change-Id: Iaf9a10b28a1d8b7d5313cef8ea8a2f414bae2ab7
Reviewed-on: https://dart-review.googlesource.com/69820
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-13 22:15:41 +00:00
Dan Rubel 9619e2cd77 Remove unused fasta parser methods and event parameter
Change-Id: I0bf050a475ad3548342307027d14aba4badf468e
Reviewed-on: https://dart-review.googlesource.com/69620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-13 16:42:12 +00:00
Daniel Hillerström b244c0805d Extends the type checking of async functions to check whether the
declared return type of an async function is a super type of Future<T>
for any T.  In case the check is not successful an error message is
produced. The location of the name of the offending function
declaration is used as location information for message. Ideally we
would use the location of the type, so until types get annotated with
location information the error message remains suboptimal.

This closes #33425 and closes #34057.

Thanks to dmitryas and jensj for their helpful guidance.

Bug: dartbug.com/33425 dartbug.com/34057
Change-Id: I3b3dadc25b574422ea1f38671fe8cba3ffdd494c
Reviewed-on: https://dart-review.googlesource.com/69307
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-13 12:22:47 +00:00
Konstantin Shcheglov 5a2a13c8bf Store and resynthesize codeOffset/codeLength for functions and methods.
R=brianwilkerson@google.com

Change-Id: I2106fb407b7488eede8c06112f1ac582b92d6af5
Reviewed-on: https://dart-review.googlesource.com/69400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 21:37:02 +00:00
Konstantin Shcheglov fe0640e3b1 Refactor way of providing file info, set codeRange for units.
This fixes a lot of search/refactoring tests, about 200.

R=brianwilkerson@google.com

Change-Id: I6ce5f61a08b8effa73ffde3861ff68eadd1f4e04
Reviewed-on: https://dart-review.googlesource.com/69383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 20:43:54 +00:00
Sam Rawlins 761178e471 Fix DEAD_CODE issue when break label is found inside a for-each.
Fixes #31714.

Bug: https://github.com/dart-lang/sdk/issues/31714
Change-Id: I36580a16604765497ee117625cb0b035603a69f3
Reviewed-on: https://dart-review.googlesource.com/69281
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 19:39:13 +00:00
Devon Carew 4c659e9f83 Have --use-cfe contribute to the driver signature.
Change-Id: Ica21f166bde60e41e19c3e6ab49e05a29540b0b0
Reviewed-on: https://dart-review.googlesource.com/69320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-10 18:11:41 +00:00
Konstantin Shcheglov 28583df3ee Store codeOffset / codeLength for classes.
Change-Id: Ief9d529df814d9b4f33f98c485de6b91c6bd2f69
Reviewed-on: https://dart-review.googlesource.com/69280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 16:25:22 +00:00
danrubel 8e2141f1cf Fix parsing typedefs with <T>=
This is the first CL of several needed to fix typedef parsing
when there is no space between the type parameters and the `=`.

  typedef F<T>= T Function(T);

* Fix some typedef parsing failures
* Add new consts for simple type var ending with ">>" and ">="
* Update computeType and computeTypeParamOrArg to return new consts
* Extract splitGtEq/GtGt/GtGtEq from splitEndGroup
* Hide internal TypeInfo and TypeParamOrArgInfo consts

Change-Id: Ice550f5b15df1f3cad616a2a342644974f14d8ee
Reviewed-on: https://dart-review.googlesource.com/69261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-10 15:09:21 +00:00
Aske Simon Christensen f2766eb24e Disallow references to this in field initializers.
Fixes https://github.com/dart-lang/sdk/issues/33858

Change-Id: I619de64353ac5131d949d8e3898617435e9f6dcc
Reviewed-on: https://dart-review.googlesource.com/68920
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-10 11:12:58 +00:00
Konstantin Shcheglov 666c8c1a89 Fix @visibleForTemplate tests on Windows.
TBR

R=brianwilkerson@google.com

Change-Id: I97ac89b7f3207a60fb2512a2a0af5aba231a7a35
Reviewed-on: https://dart-review.googlesource.com/69244
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-09 22:52:33 +00:00
Konstantin Shcheglov 29401573d5 Get documentation comments before metadata as well.
I think this is a quite often case in AngularDart.

/// Some comment.
@Component(...)
class MyComponent {...}

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

Change-Id: Icf6cff82db82e6641a37464e300c3daf50572368
Reviewed-on: https://dart-review.googlesource.com/69202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 22:18:22 +00:00
Brian Wilkerson 1be785ae2d Clean up some dead code
Change-Id: I9f722a9311336968f7756f752f2a3d77e0d12c45
Reviewed-on: https://dart-review.googlesource.com/69183
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 18:51:24 +00:00
Sam Rawlins 7818db20a7 Add analysis hint for invalid use of @visibleForTemplate code.
Bug: https://github.com/dart-lang/sdk/issues/33353
Change-Id: Iaafccc3dca6b8d87bd54ed721871c72e9ac456c8
Reviewed-on: https://dart-review.googlesource.com/68432
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 16:51:45 +00:00
Konstantin Shcheglov a1ca88f554 Resolve invocation arguments to parameters.
R=brianwilkerson@google.com

Change-Id: I76a8ea8221e0a888253af8297fb50c423699e175
Reviewed-on: https://dart-review.googlesource.com/69000
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 21:38:59 +00:00
Konstantin Shcheglov eab492385c Updates for passing / failing analysis_server tests.
R=brianwilkerson@google.com

Change-Id: Ica615414f567cf62bb631824f95d9ef45b8a777a
Reviewed-on: https://dart-review.googlesource.com/69003
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 20:47:25 +00:00
Dan Rubel 1cd9175e3e Fix mixed dartdoc processing
This change should fix the failing ResynthesizeAstStrongTest.test_class_documented_mix test.

Change-Id: I0b89fa5ddbb4725ec0115836e8b5e801d18678c5
Reviewed-on: https://dart-review.googlesource.com/68900
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 14:59:13 +00:00
danrubel 1f4449658d Refactor dartdoc parsing
This alters the way that dartdoc is parsed,
preventing null comment references from being pushed onto the stack.
This removes the need to remove those nulls prior to creating
the documentation comment AST nodes and allows for fixed sized lists.

This also address comments in:
* https://dart-review.googlesource.com/c/sdk/+/68520
* https://dart-review.googlesource.com/c/sdk/+/68461

Change-Id: I679c425b5d1f3f7954281d226815a80e73dcc033
Reviewed-on: https://dart-review.googlesource.com/68780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 22:28:55 +00:00
Konstantin Shcheglov cb4f5b3a3a Resynthesize nameOffset for properties/parameters.
R=brianwilkerson@google.com

Change-Id: Ib3213529836df20f580a5d8805006ba13b82bf20
Reviewed-on: https://dart-review.googlesource.com/68761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 21:54:55 +00:00
Konstantin Shcheglov c30af508a4 Store import prefix offset into metadata and resynthesize.
Change-Id: I7ef72c562323f132865c7cb6b3b068623c831043
Reviewed-on: https://dart-review.googlesource.com/68741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 18:17:46 +00:00
Konstantin Shcheglov 80e08e0913 Use 'useCFE' flag to turn on CFE in AnalysisDriver.
R=brianwilkerson@google.com

Change-Id: If0aa7d10bc46f1dd408d0be8128fc25538758359
Reviewed-on: https://dart-review.googlesource.com/68720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 16:12:47 +00:00
danrubel 98cf15cf5b Remove unnecessary commentToken parameter
Minor cleanup to the dartdoc parsing API

Change-Id: I7aa4c0116277beeef39553f1c133aa1ab8904d61
Reviewed-on: https://dart-review.googlesource.com/68700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-07 16:07:09 +00:00
danrubel 89fd468b89 remove unused DocumentationCommentToken.references field
Change-Id: Ia35dfe2c69d4f35d3a54dd0fcb026de23d888d1c
Reviewed-on: https://dart-review.googlesource.com/68520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 16:07:09 +00:00
danrubel 49b18446c2 Refactor dartdoc parsing
This extracts and refactors a sizable chunk of dartdoc parsing out of AstBuilder
and into the fasta parser. Parsing dartdoc does not happen unless the listener
calls the new fasta parser parseCommentReferences method.

The new parseCommentReferences method generates a handleCommentReferenceText
event for each comment reference encountered. The listener calls the scanner
to tokenize the comment reference and forwards the result to a new
fasta parser parseOneCommentReference method. This method generates either
a handleCommentReference or a handleNoCommentReference depending upon
whether or not a reference is parsed.

parser.parseCommentReferences
* generates handleCommentReferenceText events
* returns # of events generated

listener.handleCommentReferenceText
* calls parser.parseOneCommentReference

parser.parseOneCommentReference
* generates either handleCommentReference or handleNoCommentReference

There are further improvements to be made, but I believe this chunk
will allow progress to be made on the kernel side.

Change-Id: I393dc4d1d4791b3d7a529f6cb3c16db3a5befddf
Reviewed-on: https://dart-review.googlesource.com/68461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 16:07:09 +00:00
Konstantin Shcheglov 737e546939 Resolve invalid return from constructor.
Change-Id: Ibec6d4e307b22fedb78a72531c852480a61cd8eb
Reviewed-on: https://dart-review.googlesource.com/68501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-07 02:45:08 +00:00
Janice Collins 1a704502d7 Update examples to always use sources and errorListeners.
Change-Id: I967725e53792325d8813500069fee0ce1afc2811
Reviewed-on: https://dart-review.googlesource.com/68425
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-06 23:25:40 +00:00
Konstantin Shcheglov 77202bf2b0 Resolve invalid 'as' constant expression.
Change-Id: I4d9463fe60a47ec2dc44d5da30d4923b20244e45
Reviewed-on: https://dart-review.googlesource.com/68428
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 21:12:06 +00:00
Konstantin Shcheglov cec29e4aa8 Infer original expression in SyntheticExpressionJudgment.
Change-Id: I91a27d06ccf4197274fc96597d384ba4e2335dbd
Reviewed-on: https://dart-review.googlesource.com/68426
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 21:04:22 +00:00
Brian Wilkerson 17b54c76ce Improve error detection in search code
Change-Id: If935e9e8fda4f8b92e18a7fe579e838a1451e71f
Reviewed-on: https://dart-review.googlesource.com/68441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 17:41:04 +00:00
Konstantin Shcheglov 8df84c0a00 Store resolution for out of range integer literals.
R=brianwilkerson@google.com

Change-Id: Ice783c3fc279bfd34a5aeebf4e9e9f5f014c000b
Reviewed-on: https://dart-review.googlesource.com/68423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-03 20:32:38 +00:00
Konstantin Shcheglov 8114ecb351 Fix tests after fixing constant fields with CFE.
TBR

R=brianwilkerson@google.com

Change-Id: I121694e2f7f865b521110bf41875f4557e456e33
Reviewed-on: https://dart-review.googlesource.com/68420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-03 18:55:54 +00:00
Konstantin Shcheglov 85edb76c48 Fix field constants verifying with CFE.
TBR

R=brianwilkerson@google.com

Change-Id: I7960249e95c48cb51d8ca593df93381398e94d8a
Reviewed-on: https://dart-review.googlesource.com/68400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-03 18:25:25 +00:00
Konstantin Shcheglov 8692936f48 Verify constants using Analyzer.
This fixes 44 failing language_2 tests.

Change-Id: I9248a940c56764d030e5cb1c8d558a3d41b88899
Reviewed-on: https://dart-review.googlesource.com/68340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-03 17:39:54 +00:00
danrubel 368bcc47df Add parse dartdoc tests for fasta parser
Change-Id: Ieb8ed7d09abdae097f991aae566cd6256b18ef24
Reviewed-on: https://dart-review.googlesource.com/68202
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-03 14:55:56 +00:00
Dmitry Stefantsov 637e55d4be [kernel] Add VariableDeclarations to represent formals of Typedefs
Change-Id: Ic1575dadb4fcf644dfdeb436612e2bed72d41a03
Reviewed-on: https://dart-review.googlesource.com/68083
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-08-03 12:28:11 +00:00
Konstantin Shcheglov 380696fe3f Set element/type for some resynthesized expressions.
R=brianwilkerson@google.com

Change-Id: I4a3d809fedac9eeb17eb996f8206a946201d6da8
Reviewed-on: https://dart-review.googlesource.com/68260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-02 23:56:47 +00:00
Konstantin Shcheglov 62a2752b96 Translate ConstructorElement(s) of parameterized InterfaceType(s) to ConstructorMember(s).
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I865a2e96f691d827165eabf382b5677d0831e831
Bug: https://github.com/dart-lang/sdk/issues/33506
Reviewed-on: https://dart-review.googlesource.com/68161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-02 22:14:59 +00:00
Brian Wilkerson 87f753dbd3 Replace some declarations of element with declaredElement
Change-Id: Idd62472b16cccaa98749a510197ec8d0f5053cb1
Reviewed-on: https://dart-review.googlesource.com/67820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-02 16:00:36 +00:00
Konstantin Shcheglov 4bb3fb6cae Don't rewrite error Severity for special cases of front-end testing.
IIUC this rewriting was done to internally check front-end better, but
it get in the way of running analyzer, and these errors are not mandated
by the spec. So, I decided that I don't want doing rewriting in
Analyzer / CFE integration.

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

Bug: https://github.com/dart-lang/sdk/issues/34042
Change-Id: I1bb41b271d8d84eace9bd13a269bcac157e9f89b
Reviewed-on: https://dart-review.googlesource.com/68006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-02 15:41:12 +00:00
Konstantin Shcheglov d6189709b8 Issue 33506. Rewrite MethodInvocation into InstanceCreationExpression.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I712ab3c79cfe29b2c201b0affc10b33fc0f60d15
Bug: https://github.com/dart-lang/sdk/issues/33506
Reviewed-on: https://dart-review.googlesource.com/68004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-02 15:33:11 +00:00
Jens Johansen 26e087e66b Don't save Tokens in Judgments
Before this CL, Judgments save Tokens in final fields.
This can take up quite a lot of space, and isn't actually (currently)
used for anything. Eventually it will be used in Analyzer.

This CL changes it so Judgments instead carry a `box` that is in
`non-analyzer-mode` just null, and in `analyzer mode` stores the Tokens
directly.

When running dart2js through the VM, this decreases the memory footprint
quite a lot, and seems to make the compile faster.

Details:

Removing the Tokens decrease the memory usage by almost 50MB
("Maximum resident set size" (as reported by /usr/bin/time -v)),
and more than 66MB from the old space in the kernel isolate after
ended compilation and changed the compile time of dart2js by
-7.71201% +/- 6.22211% (presumably because of less pressure on the GC).

For more details see the review page comments.

Change-Id: I7a31927f104e111c1b16be10b35f4164959a2130
Reviewed-on: https://dart-review.googlesource.com/67720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-02 12:44:02 +00:00