As requested in #31691 the incremental compiler should be able to
initialize its state from a previously generated dill file.
This CL introduces that functionally.
It is tested, but actual usage (e.g. proper invalidation of old files)
should live outside of the front-end (i.e. it's the callers responsibility).
One option would be for the caller to load the dill file and use the
included sources to invalidate changed files.
On my machine a from-scratch compile of dart2js takes ~5 seconds,
one initialized from such an output and with a single file invalidated
(though it actually hasn't changed) it takes ~1 second and the resulting
dill file is bit-perfect compared to the from-scratch compiled one.
Closes#31691.
Change-Id: I07f5efca5f2684d73f6c252f2dbc2ad04e9b5cd0
Reviewed-on: https://dart-review.googlesource.com/37260
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This is a branch of co19 tests where the tests have been
made strong mode compliant. A co19_2_analyzer.status file
has been added with the current statuses of the tests when
run on dartanalyzer --strong. We expect more Dart 2 configurations
to start running these tests and adding status files.
Change-Id: I22077272707620b92dd1092c38bbb4f3d5964493
Reviewed-on: https://dart-review.googlesource.com/37743
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This reverts commit a6e59cc351.
Reason for revert: Timeout for these tests was increased in the recipes instead. We do want all of these tests to run.
Original change's description:
> [Gardening] Marked pkg/front_end/test/fasta/compile_test.dart as 'Timeout' in pkg.status
>
> Change-Id: Ibf91848efef99159bb93b7ad46da91d4de9763ed
> Reviewed-on: https://dart-review.googlesource.com/37922
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
TBR=brianwilkerson@google.com,bkonyi@google.com
Change-Id: Id7dbb5241505c97c55b4469357d070e76bd42270
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/37662
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
It was pointed out that the previous fix
(5c74e0e16f) wasn't strong mode safe
because the returned array when length = 0 was not properly typed.
This fixes the issue by removing the old fix and simply removing the
assert.
Bug: 31381
Change-Id: I6d63d3329da2711067f632adbb9be998a4d468d9
Reviewed-on: https://dart-review.googlesource.com/37741
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
also fixes#31058, DDC failed to execute all field initializers
(already fixed this in DDK when porting code_generator).
also fixes assertion_initializer_test, it was not strong mode clean, so
it was not giving any meaningful results for runtime behavior.
Change-Id: I290b266ad77ed92851cc2d0617690c6c021182a3
Reviewed-on: https://dart-review.googlesource.com/37866
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Since dart2js doesn't implement Dart 2 yet, the RuntimeError status must
be copied for each of the many dart2js configurations.
Change-Id: I7814546ce808922bf62c12d6c5443eee8600a5c7
Reviewed-on: https://dart-review.googlesource.com/37940
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Before any ASTs are constructed, a lookup happens to see if such a constructor exists, otherwise the AST replacement will not proceed, and even temporary ASTs will not be created: in this way we can add the test test_visitMethodInvocations_not_implicit_constructor.
Change-Id: I01e25af5d1eaec659cf02ca89f8a9a5da334e6a9
Reviewed-on: https://dart-review.googlesource.com/37920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
As far as I can tell, this case never gets hit because there is separate
support for ignoring cast failures on function types elsewhere.
Change-Id: I78bd8d0af10764477505545384f5103f294228bf
Reviewed-on: https://dart-review.googlesource.com/37648
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Dart allows 'external' functions which are not connected to their body.
Calling such functions produces runtime error, but they should be accepted
at compile time. Test language_2/external_test verifies this behavior.
This CL fixes treeshaker/findNativeName to return 'null' instead of throwing
an error for 'external' functions without @ExternalName annotation (which
is used to specify native name).
Change-Id: I04ec892af29ffe064ece8fddd6f67c7acdca1139
Reviewed-on: https://dart-review.googlesource.com/37122
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This reverts commit 2912e95451 as it introduced a flaky test.
Change-Id: I09c5d64eb2fe75ed67b6af5aa60b91de88f4bbda
Reviewed-on: https://dart-review.googlesource.com/37865
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This CL removes .staticType from all Types and most Statements as they
are not currently used.
Change-Id: Ia29bac49327356b26395c4851d84941daf61614d
Reviewed-on: https://dart-review.googlesource.com/37124
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* _ReceiverTypeBuilder class is introduced to create receiver type more
efficiently (without using union operations and creating intermediate
types).
* Certain tracing prints are hidden behind kPrintTrace flag to avoid
expensive string interpolations.
* Also, added debugging flag for dumping class hierarchy.
This CL reduces analysis time of Flutter gallery by ~2x.
Change-Id: Ia918b88a4d902895e77aac306dc6a5cf9cecad14
Reviewed-on: https://dart-review.googlesource.com/37644
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@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>
'void' is now allowed as type annotation for locals, fields, and formal
parameters, in addition to being previously allowed as type argument.
Update status files.
Change-Id: I6459f56824dc0a695615d8dc87c9a8a1f9be29ef
Reviewed-on: https://dart-review.googlesource.com/37651
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Dart 2 has no notion of "checked mode", so a failed assertion in a
const constructor should always be a compile error.
Change-Id: I02227c03613346918de1e3a7f7c70d209a940b90
Reviewed-on: https://dart-review.googlesource.com/37647
Reviewed-by: Leaf Petersen <leafp@google.com>
Whenever we install a getter or setter, we need to install a corresponding
one that calls `super`, because JS treats getters/setters as pairs for the
purposes of lookup. Normally we generate the paired super accessor, but for
mixins we cannot, because we don't know what the `super` will be at compile
time. So the fix is for `mixinMembers` to handle it at run time.
Change-Id: I2b14ea437720bd26f2879c7daac5b3f796d48038
Reviewed-on: https://dart-review.googlesource.com/37645
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
This change will make it easier to transition to FIDL2.
Change-Id: Ibd69f9cb60687630b81306d5931134916d4d1d84
Reviewed-on: https://dart-review.googlesource.com/37640
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>