This CL finishes the process of removing findMemberName from parsing
class members and sets the stage for improved recovery.
In addition, this CL:
* Revises the `endMethod` event to include a beforeParam token
so that the parser can revise the token stream before the parameters
during recovery.
* Reworks insertSyntheticIdentifer for use in more places
Change-Id: If5bcd6f554053f72429e938b5cd5e7021e03d5b3
Reviewed-on: https://dart-review.googlesource.com/39320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This separates and cleans up externally called fasta parser methods
such as parseTopLevelMember and parseMember from internal callers.
* Split external and internal calls to parseTopLevelMember
so that external callers use parseTopLevelMember
and internal callers use parseTopLevelMemberImpl.
* Rename the externally called parseMember --> parseClassMember
and the internally called parseClassMember --> parseClassMemberImpl
* Revise the insertSyntheticIdentifier method and cleanup some
exiting recovery code to use it.
Change-Id: Ic66ddcbbe761937bb917c679590fc7de2fdd0396
Reviewed-on: https://dart-review.googlesource.com/39080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.
Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
From the docs of mixedInClass and mixin: the former is the direct thing that is
mixed in, but if it is a named mixin application it may not contain the actual
fields and procedures, instead the `.mixin` class does.
Change-Id: I049ced771925431d613b0b661154c1761fbe0a51
Reviewed-on: https://dart-review.googlesource.com/38161
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
This CL refactors parseTopLevelMember so that it does not scan ahead
using findMemberName. This is the next step in removing findMemberName
to improve top level declaration recovery.
Change-Id: I4d949f72cba5618541448c08e1756bf45a4d1762
Reviewed-on: https://dart-review.googlesource.com/37680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Per discussion with Peter, this CL updates all begin* and handleNoType
events to take atleast one token parameter.
* Ensure all fasta parser begin* events take atleast one parameter
* Update handleNoType event to take last consumed token
* Address comment in https://dart-review.googlesource.com/c/sdk/+/36820
* Remove unused skipToLastModifier method
Change-Id: I1be25fe4327a63707f74163fa2b93452d71e7748
Reviewed-on: https://dart-review.googlesource.com/36960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This CL moves modifier parsing out of parseMethod and parseFields
into parseClassMember and before findMemberName.
This is the next step in evenally removing findMemberName
and improving top level declaration recovery.
This CL also removes unused parameters from several fasta parser events.
Per discussion with Peter, tokens will be added back to each of these
events in a subsequent CL.
Change-Id: I4ffc0622b75581b5fdb527feeb19ae0b68c4eeaf
Reviewed-on: https://dart-review.googlesource.com/36820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL moves modifier parsing out of parseTopLevelMethod
and parseFields into parseTopLevelMember and before findMemberName.
This is the next step in evenally removing findMemberName
and improving top level declaration recovery.
* New ModifierRecoveryContext2 which will soon replace
both ModifierContext and ModifierContext2
* Remove now unused TopLevelModifierRecoveryContext
* Remove unused beginTopLevelMethod event arguments
* Remove unused handleNoType event arguments
* Address comment in https://dart-review.googlesource.com/c/sdk/+/36500
Change-Id: I6842a83d9604cdcca611d7209e3ebcc78de469d3
Reviewed-on: https://dart-review.googlesource.com/36680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Two follow-on optimization would reduce the generated code to closer to the original size:
- It would be profitable to write an optimization the removes the type
information from any list when it can be proven the type information
is not used.
- Provided the split result list is not modified, we can strengthen
accesses to be non-null Strings.
Bug: https://github.com/dart-lang/sdk/issues/30548
Change-Id: I87ecdd129ec0227f982bd2e1f34193b3d6b0d81b
Reviewed-on: https://dart-review.googlesource.com/35081
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
In addition to adding missing errors, this CL inlines modifier parsing
as part of a multi step effort to parse modifiers once and provide
better error recovery for class member and top level declarations.
Change-Id: Ibea91a4a3e2073ed6079f0f44ff4bbbb4a98a614
Reviewed-on: https://dart-review.googlesource.com/35300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
... for generic methods and local function. Also update capture
conversion to recognize the new kinds of type variables.
Change-Id: I9b8771b0ebe6c9e926712fa31b0bdea966cc6a25
Reviewed-on: https://dart-review.googlesource.com/34600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Just noticed that the 'supportsRelection' flag was not checked when running with
'--use-kernel'.
Change-Id: I9f4bd540ad963c33c8b9013860ac63b1c6707299
Reviewed-on: https://dart-review.googlesource.com/35006
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
- Ignore ir.Instantiation in type inference
- Add 'special' Selectors, use for $instantiateN
- Lower ir.Instantiation to a call
Change-Id: I9da05014c10c9cddf9b32f6a492fab6ac2ad2f88
Reviewed-on: https://dart-review.googlesource.com/34421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
In addition to improving modifier recovery, this CL
* Improves recovery when builtin keywords are used as types
* Updates ModifierContext to avoid parsing modifiers used as identifiers
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/34200
* Streamlines missing class body recovery
* Ensures the endMember event is sent during recovery
Change-Id: I87bda7c7da9d0e951427037087c7aa7e8e4da109
Reviewed-on: https://dart-review.googlesource.com/34520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
- fix some discrepancies between old and new deferred loading.
* Kernel is now using the correct world impact
* For the old FE, I'm more careful about avoiding metadata nodes when mirros
are disabled as well.
* Better approximate when a constant is deferred in the kernel codegen
- make 'dump()' independent of the IR, so we can easily compare them side by
side.
- exclude primitives in kernel since we don't need to track them. I
didn't change the old front end because it is not as easy to do. I did this
change because kernel was processing many more constants than the old frontend
(the old frontend skipped constants that were never evaluated, we have no way
to do it selectively like that in the new front end).
Change-Id: I337d3fd818753125476b7390da5d900ebdc02709
Reviewed-on: https://dart-review.googlesource.com/34509
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Some additional optimization work will need to be done at the end so
that we take out these functions when they are not needed (when we
don't have type variables).
Bug:
Change-Id: I28d59d04844ec18510b9befe45f26f4109d86ffa
Reviewed-on: https://dart-review.googlesource.com/32667
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- closed world is incomplete anyway; we're missing the call methods from static and instance tear-off.
Change-Id: Ibd3fc9d80220bef3ee651bf529a487b617de7a6b
Reviewed-on: https://dart-review.googlesource.com/34144
Reviewed-by: Sigmund Cherem <sigmund@google.com>