Commit graph

75833 commits

Author SHA1 Message Date
Ryan Macnak 6bcdcb5c68 [vm] Don't allocate on the Dart heap when printing stack traces.
Bug: https://github.com/dart-lang/sdk/issues/43642
Bug: b/169880355
Change-Id: Ib067eb8c8183367442cffa5b0975d5264ccc3017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166244
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-07 17:09:37 +00:00
Alexander Markov 0e9b2b8a36 [vm/compiler] Fix assertion when assigning type to a Phi in ComputeSSA
Fixes https://github.com/dart-lang/sdk/issues/43682

Change-Id: I6b123ac5ba153b1f4177148341619419c3058684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166304
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 16:30:17 +00:00
Jacob MacDonald 1e450cadde Remove reference to nullable StackTrace from Stream.listen docs.
The StackTrace argument will never be null, but may be a default.

Also rewrite the type descriptions to use function type syntax instead
of the legacy argument syntax, and remove a redundant parameter name.

Bug: #43655
Change-Id: Ie91024b2a70d66c24ce29e413c811a61beae3bfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166460
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-10-07 15:58:15 +00:00
Paul Berry ed2f45d56d Ensure that if statements promote properly in unreachable code
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I04a5af558bb70b861d92b5379a8fb84489d5c9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165402
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 15:32:25 +00:00
Ben Konyi f474b1697e [ Service ] Include flags and options with custom handlers in getFlagList
RPC response

Fixes https://github.com/dart-lang/sdk/issues/43588

Change-Id: I7fa98dd2218d182e80f682a2fd6a3a4150509dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166260
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-07 15:23:25 +00:00
Sam Rawlins ae466ef7d5 analysis_server: Bump to pedantic 1.9
Change-Id: Iec6c21abe09ecfbd74c4e1b18c0f519c0416467b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163304
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-07 13:41:35 +00:00
Paul Berry e933e91aaa Reland "Flow analysis: promote to non-nullable on initialization"
This is a reland of 6a1c54ec30

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Bug: https://github.com/dart-lang/sdk/issues/43099
Change-Id: I7530bb0f7c24674a7b500558b89d50b35e045aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166305
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-07 13:14:55 +00:00
Paul Berry 19995ba7cd Replace flow ranalysis reachability bool with a stack.
Currently we don't push or pop anything on the stack, we just
manipulate the single value that's on the stack.  So there's no
functional change.  Logic that pushes and pops the stack will be added
in a follow-up CL.

Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I4deb4cbe06644a2b2c9b5e2c1dc140fb4cd805cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165145
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 12:13:54 +00:00
Johnni Winther 749b622a6b [cfe] Don't override language version of opt-out libraries in strong mode
This change compiles opt-out libraries with opt-out semantics even when
sound null safety was requested. The compile-time error that libraries
cannot opt out with sound null safety is still produces but spurious errors
from interpreting opt-out as opt-in are avoided.

This also aligns the compilation of from-source with from-dill for the
case of opt-out libraries in face of sound null safety.

Closes #43327

Change-Id: I19d659219b7c7b357d15fc5f1ca4415fe1fc4592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166243
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-07 08:43:25 +00:00
Dmitry Stefantsov 3b4fe0dc06 [cfe] Use computeRawType in Null Safe UP and DOWN
Closes #43536.

Bug: https://github.com/dart-lang/sdk/issues/43536
Change-Id: I6616739e7ac0eb0be084988cef0460e916a3b448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165804
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 08:40:34 +00:00
David Morgan 5a442b4f62 Update to the latest version of package:tflite_native.
Change-Id: Ieba83cc4d632eb8db3c0054210040fd8ade5d74a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166380
Reviewed-by: Michal Terepeta <michalt@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-10-07 08:11:35 +00:00
Jens Johansen f59c86160c [CFE] Short-circuit certain types in ConstantEvaluators _evaluateSubexpression
TL;DR on the below: On a big internal app, this makes the constant
evaluator ~17% faster and use less ram.

Details:

Detauls for 5 runs before this CL and with this CL when compiling a big
internal app with dart2js (stopping at around "stopAfterClosedWorld"
with instrumented code available as patch-set #1):

Original:
Spend 9829 ms in ConstantEvaluator.
Spend 9935 ms in ConstantEvaluator.
Spend 9769 ms in ConstantEvaluator.
Spend 9725 ms in ConstantEvaluator.
Spend 9915 ms in ConstantEvaluator.

With this CL:
Spend 8110 ms in ConstantEvaluator.
Spend 8080 ms in ConstantEvaluator.
Spend 8183 ms in ConstantEvaluator.
Spend 8174 ms in ConstantEvaluator.
Spend 8155 ms in ConstantEvaluator.

Difference at 95.0% confidence
        -1694.2 +/- 103.924
        -17.2269% +/- 1.05672%
        (Student's t, pooled s = 71.2569)

Original:
Maximum resident set size (kbytes): 13164908
Maximum resident set size (kbytes): 13179968
Maximum resident set size (kbytes): 13226748
Maximum resident set size (kbytes): 13296908
Maximum resident set size (kbytes): 13220740

With this CL:
Maximum resident set size (kbytes): 13006996
Maximum resident set size (kbytes): 13006720
Maximum resident set size (kbytes): 13020884
Maximum resident set size (kbytes): 13018172
Maximum resident set size (kbytes): 13160120

Difference at 95.0% confidence
        -175276 +/- 86297.8
        -1.32605% +/- 0.652888%
        (Student's t, pooled s = 59171.2)

Original:
Minor (reclaiming a frame) page faults: 5720311
Minor (reclaiming a frame) page faults: 5688423
Minor (reclaiming a frame) page faults: 5693923
Minor (reclaiming a frame) page faults: 5699729
Minor (reclaiming a frame) page faults: 5650061

With this CL:
Minor (reclaiming a frame) page faults: 5612492
Minor (reclaiming a frame) page faults: 5603543
Minor (reclaiming a frame) page faults: 5600394
Minor (reclaiming a frame) page faults: 5628675
Minor (reclaiming a frame) page faults: 5621994

Difference at 95.0% confidence
        -77069.8 +/- 29166.7
        -1.35436% +/- 0.512552%
        (Student's t, pooled s = 19998.5)


Said another way, we have some confidence that this change decrease the
runtime of the constant evaluator with ~17% on this application.
Similar we have some confidence that this change decrease the memory
usage with ~1.3% overall for dart2js (note though, again, stopping
early), or something like ~170MB less memory in this case.
(And having a similar percetage less minor page faults).

Change-Id: Ib269ad50f705b967e0e60e88fdcbfd9b050b3a24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166105
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-07 07:33:35 +00:00
David Morgan 0efbb96545 Revert "Return declared elements for linked AST nodes."
This reverts commit 706ab39eba.

Reason for revert: Analyzer crash b/170276354

Original change's description:
> Return declared elements for linked AST nodes.
>
> For now only top-level nodes and elements, will do class members later.
>
> These changes would be useful to fix matching elements and nodes, e.g.
> https://github.com/dart-lang/sdk/issues/43153 or https://bit.ly/3jCfhVx
>
> Change-Id: I37861ba60b4e70f637019bf4f8a4d0d007c97965
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166200
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

Change-Id: I0b13f9e4fbecf9cb0e4d059580837f79bd1cf2b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166381
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-10-07 07:33:00 +00:00
Johnni Winther a49217bc3a [cfe] Add test to verify legacy main method requirements
Change-Id: I3173d85ffe1d92840458fb28fcf2073bec3899ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166241
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-07 06:48:03 +00:00
pq f122752b99 display progress while fixing and display a count summary on exit
Sample output:

[~/src/repos/dart/sdk/pkg/analyzer] (master) $ dart ../dartdev/bin/dartdev.dart fix

*** The `fix` command is provisional and subject to change or removal in future releases. ***

Computing fixes in analyzer...         43.8s
Applying fixes...                      15.5s
Fixed 359 files.



Fixes: https://github.com/dart-lang/sdk/issues/43569

Change-Id: Ief3c9edf578f74413352cdd0a8d84996b1de05f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166302
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-07 05:14:03 +00:00
Alexander Markov 34e8b4229e [tests/nnbd] Mark test as slow in debug mode, add diagnostics
Issue: https://github.com/dart-lang/sdk/issues/43613
Change-Id: I12fe82b3dc2eced6e0c582ecc487ef140e5edc40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165365
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 02:01:23 +00:00
Loren Van Spronsen 2a649d3ef0 Update README.md comments concerning constants.
The existing comments contain references to abstractions (constant system) and implementations
(dart2dart constant folding), which no longer exist.

Change-Id: Iaea64225ec82a12333e791fbb1df0ed5c70c8757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166141
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-07 00:31:43 +00:00
Konstantin Shcheglov d758af07b5 Several changes to Cider library context.
I'm still not able to reproduce the "Missing library" issue.
But I making several changes that might help.

Change-Id: Ieed6f14351a109565d20019deae6bf6e72e78112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166306
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-06 23:10:26 +00:00
Keerti Parthasarathy 31ea2200b8 Convert to list to avoid 'Adding to unmodifiable list' exception.
Change-Id: I1c5a6dad96435d8059d5d05362ab938cb91435b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166303
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-10-06 22:13:53 +00:00
Konstantin Shcheglov 706ab39eba Return declared elements for linked AST nodes.
For now only top-level nodes and elements, will do class members later.

These changes would be useful to fix matching elements and nodes, e.g.
https://github.com/dart-lang/sdk/issues/43153 or https://bit.ly/3jCfhVx

Change-Id: I37861ba60b4e70f637019bf4f8a4d0d007c97965
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-06 22:08:53 +00:00
Sam Rawlins 19ada0706e Report indirectly exporting @internal typedef
This type of exposure was brought up by Lasse at afbb8f9063 (r42686423).

New "Indirect exposure" section in the doc: https://docs.google.com/document/d/130E4qfsjqRWtSNpIoNM628zVwGP-8W4J1P7W3wzJG8c/edit#

Change-Id: If38889b2134719804aa8cbaf613c8eb33cb6d949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-06 21:58:23 +00:00
Mark Zhou 38667e5667 [dartdevc] Lazily executing deferred types to prevent improper module reordering.
Supercedes the following (reverted/abandoned) CLs:
  * https://dart-review.googlesource.com/c/sdk/+/162383
  * https://dart-review.googlesource.com/c/sdk/+/165149
  * https://dart-review.googlesource.com/c/sdk/+/165782

Fixes https://github.com/flutter/flutter/issues/66859 and https://github.com/flutter/flutter/issues/64011

Thanks to Siggi for this approach!

Change-Id: I8e496fdb938e18252ec8a0cf7232c99ca8c27080
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166127
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-10-06 21:31:33 +00:00
Paul Berry ab4818c251 Fix bad flow analysis unit test for restrict.
I'd always meant to test the cartesian product of possible
reachabilities for the `restrict` function.  Due to a copy/paste error
I was missing one of the four possibilities.

Change-Id: I3a99c72051e7f12afd8f345d8c2dafe92d6e2c48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-06 21:20:27 +00:00
Sam Rawlins 1df5c58d29 Analyzer: Move MustCallSuperVerifier to its own library
This will make it easier for upcoming bug fixes. Calling this verifier
in BestPracticesVerifier means it will only be run when hints are
enabled, perhaps boosting performance.

Also add a few more test cases.

Change-Id: If22ab02313d9f98f067ad4325b2f5ac473f4862c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164580
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-06 20:15:33 +00:00
Alexander Markov c7f0143900 [vm/aot/tfa] Remove uses of VariableGet.promotedType
Previously (before NNBD) VariableGet.promotedType was used when
variable type was promoted after a successful 'is' test. TFA used that
to infer non-nullability in certain cases (successful 'x is int'
implies that x is non-nullable).

However, this is no longer true as front-end started to use
promotedType in more cases. Also, TFA should be able to
infer the same non-nullability from the successful 'is' test itself.
So this change removes use of VariableGet.promotedType from TFA.

Change-Id: Id14dafad4451453572d6f20ff567b7792f17881a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165625
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-06 20:14:53 +00:00
Alexander Markov 447a66a326 [vm/compiler] Fix LoadField canonicalization for typed data
Fixes https://github.com/dart-lang/sdk/issues/43679

Change-Id: I20002208d7c25fad39c3e7d7698b8614322a9e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166128
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-10-06 18:41:03 +00:00
Paul Berry 2c40d6a22a Fix CFE legacy type promotion.
The previous implementation of type promotion in the CFE was unsound,
didn't follow the spec, and contained a lot of unnecessary logic
related to experiments that eventually led to flow analysis.  This
change updates type promotion to be nearly spec compliant and removes
most of the unnecessary logic.

The lack of spec compliance went (astonishingly) unnoticed for over
three years, probably mostly due to the fact that for the most part it
promoted more eagerly than it should; as a result, any code that was
erroneously accepted by the CFE was rejected by the analyzer.
Unfortunately, in at least one case the erroneous promotion led to
incorrect VM behavior (issue #43640).

There's one aspect in which the CFE implementation is still not spec
compliant.  The spec says that when analyzing an expression `e1 &&
e2`, if `e2` shows that a variable `v` has type `T`, but `e1` assigns
to `v`, then promotion does not occur.  This turns out to be difficult
to model in the existing architecture, since much of the type
promotion logic happens during parsing, and any assignments that occur
in `e1` are parsed prior to figuring out that a logical and is in
progress.  Fortunately, this is a rare circumstance, and allowing type
promotion in this situation is sound, so it should not lead to
incorrect VM behavior.  Considering how long the other incorrect logic
(which was much more severe) went unnoticed, it seems unlikely that it
will cause problems for users.

Bug: https://github.com/dart-lang/sdk/issues/43640
Change-Id: If97293733e64e286780de5079a703717b8f6f142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-06 18:12:13 +00:00
Janice Collins ee19abd31f Update dartdoc version to v0.35.0.
Release notes: https://github.com/dart-lang/dartdoc/releases/tag/v0.35.0

Change-Id: I1ff5deac6ed85ef2a54723c95c7f7e30fdd2492b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166202
Auto-Submit: Janice Collins <jcollins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-06 17:15:23 +00:00
Tess Strickland df79bd7c53 [vm] Unify the concrete implementations of ImageWriter::WriteText.
Instead of having two similar concrete implementations of WriteText
that differ mostly in the output format, abstract out the parts that
differ and create a single, non-virtual WriteText that calls the
abstracted-out methods as appropriate.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ic728cd4d3376af32780d428efba19cd36e73c3ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164562
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-06 17:10:05 +00:00
Tess Strickland 1b50200abd [vm] Simplify symbol naming/address retrieval.
Before, picking a symbol name for a Code object when generating
assembly required adding a placeholder entry in the Dwarf object,
because the Dwarf object separately used a SnapshotTextObjectNamer
to determine the appropriate symbol name to use in relocations.

Instead, now the ImageWriter subclasses are entirely responsible for
creating the symbol name for a given Code object, and that name is
passed when adding the Code object to the Dwarf object.

For Elf output, we eagerly create symbols for sections and Code objects
again in the appropriate symbol table, and so looking up the start of a
given section or Code object can be done simply by asking for the
corresponding symbol's address, removing special case methods and other
workarounds.

We also clean up the generated static and dynamic symbol tables by
only generating local symbols for Code objects and BSS sections (these
are local in assembly output also), and only adding global symbols to
the dynamic symbol table.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ie40c0c836681e98f345483136bb6860e5588ef30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166002
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-10-06 17:10:05 +00:00
Tess Strickland fca36cae39 [vm] Merge ImageHeader into InstructionsSection.
Before, we only wrapped the Instructions payloads in an
InstructionsSection in precompiled snapshots with bare instructions mode
enabled. This CL changes that to always add an InstructionsSection
wrapper in precompiled snapshots, even when not in bare instructions
mode, and moves all the information from the old ImageHeader object into
the InstructionsSection object instead. Note that in non-bare mode, the
InstructionsSection has no payload, and the Instructions objects follow
the InstructionsSection object instead of being contained by it.

This CL also wraps all implementations of AssemblyImageWriter and
SnapshotTextObjectNamer methods in a single DART_PRECOMPILER ifdef
block, since we only generate assembly in precompiled mode.  This
removes the need for the smaller DART_PRECOMPILER ifdef blocks scattered
across the AssemblyImageWriter method implementations.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I3676fb5c6675845463707acbbb4759a465cfa342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165563
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-06 17:10:05 +00:00
pq 0ecf73a301 wait for server shutdown (to prevent early termination)
Fixes: https://github.com/dart-lang/sdk/issues/43568


Change-Id: Ib9e8ac2ffaa3c37a77c913524ae455b134daa46d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166120
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-10-06 16:55:53 +00:00
Johnni Winther 3ffd9a9d90 [cfe] Add failing circular test
Change-Id: I64b9daa94aecc3ed001af86ff1ff072b6d725a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166100
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-06 15:32:05 +00:00
Karl Klose 6aa5e78819 [infra] Do not print all test results in front-end unit tests
Change-Id: I0236a0587882ecfe4ad33b094e5d6dd26e08dad2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166104
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2020-10-06 12:06:54 +00:00
David Morgan defeb7240f Revert "Update to the latest version of package:tflite_native."
This reverts commit f79c6bed7f.

Reason for revert: Causing problems for google3--I'll investigate and handle the reland. b/170193203

Original change's description:
> Update to the latest version of package:tflite_native.
>
> Change-Id: Id9eb5e5a9297a6bbdb83805c6a205663b9220937
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166140
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

TBR=devoncarew@google.com,brianwilkerson@google.com

Change-Id: I5b4823e702d15984c37401374dae27f8a6a61f15
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166103
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-10-06 10:14:05 +00:00
Alexander Thomas 3bd96a2f85 [release] Add 2.10.1 to entry to the changelog
Change-Id: I0553aec9718ef549ed02442e09e3339e097eb9a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166102
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-10-06 08:37:16 +00:00
Johnni Winther 4292d9cc28 [cfe] Handle required parameters in subtype check
+ use legacy erasure on weak mode const object checking
+ changes Null to subtype of Never when ignoring nullabilities

Closes #43606
Closes #43624

Change-Id: Ief695829c550562ec1bfd0c1145cc33c584a4b8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165805
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-06 08:34:23 +00:00
sgrekhov e4992c1124 [co19] Instantiate to bound classes/static tests enabled
Change-Id: Ie313712ed487e0e9c1be2ae82a29feb84ce3cd8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166001
Reviewed-by: Alexander Thomas <athom@google.com>
2020-10-06 08:23:36 +00:00
David Morgan 7d00f6239a Add http, http_parser and logging to null safety allowlist.
Change-Id: Ic019c13540cfd6b6f489cef17e3d7cd18df43f81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-10-06 08:03:03 +00:00
Tess Strickland 72cfc5c638 [vm] Clean up handling of payload-containing objects.
This CL adds a new PAYLOAD_SIZEOF specification to
runtime_offsets_list.h which defines InstanceSize methods given an
method name to invoke to get the header size (i.e., the size of
the object portion before the payload).

It uses this new specification to create appropriate InstanceSize()
methods for objects written to read-only sections of snapshots,
instead of needing separate size calculations for SIMARM_X64.

It adds more methods to Instructions to avoid special casing for bare
instructions mode. It also removes the special casing for SIMARM_X64,
serializing all read-only objects in the same manner even when not
in a crossword situation.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ie3e4009f4bc03688998c32281e42fa22a255731d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165501
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-10-06 07:59:33 +00:00
Devon Carew f79c6bed7f Update to the latest version of package:tflite_native.
Change-Id: Id9eb5e5a9297a6bbdb83805c6a205663b9220937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-10-06 06:23:23 +00:00
Devon Carew 4db0411cbd [pkg:vm_service] ignore four deprecated member references
Change-Id: Ibcd37a18296a072d5867b679f1bd5802d875d258
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166160
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-10-06 04:45:23 +00:00
Nicholas Shahan 59fe3d510d [ddc] Fix incorrect source maps from JS templates
JS templates should always use their own source information. DDC
was incorrectly caching and reusing templates with the same source
information in various parts of the program. This lead to incorrect
source maps and in some cases compiler crashes when the source map
in a user application pointed to source location in the SDK.

Change-Id: I11607e6f02b894ead1d350e9b3071173ba36a048
Fixes: https://github.com/dart-lang/sdk/issues/43589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166122
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-10-06 01:17:53 +00:00
pq 00594be05c don’t bulk fix options-filtered errors
Change-Id: Ifa902ffa1a30a5282f4dae3e1a9487583f9c27ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166126
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-10-06 00:40:23 +00:00
Mark Zhou 350481a93c Revert "[dartdevc] Fixing issue related to dual exports of multiple entrypoints in a cyclic import loop."
This reverts commit 53895b2270.

Reason for revert: Replacing this change with a new strategy for better module reordering.

Original change's description:
> [dartdevc] Fixing issue related to dual exports of multiple entrypoints in a cyclic import loop.
>
> See: https://github.com/flutter/flutter/issues/64011
> Change-Id: I8a11e9d3f19428a516cf7a60ee45c3bacf26545d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162383
> Commit-Queue: Mark Zhou <markzipan@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>

TBR=sigmund@google.com,nshahan@google.com,markzipan@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iee91d33d1696ffa7406b724466144ab06af80394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165873
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-05 23:49:53 +00:00
Keerti Parthasarathy 168b7201d2 Fix finding third party analysis options.
Change-Id: If6792018fa9a4a64316be034dfa4b6e14c2e03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-10-05 22:55:53 +00:00
Anna Gringauze 719094028a Ensure expression compiler worker can terminate
- add handling a 'Shutdown' message to expression compiler worker
  so the parent program can terminate it before exiting itself

Closes: https://github.com/dart-lang/sdk/issues/43513
Change-Id: I18a4cbd9214a5e72c90d725039c2936e6e67a231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163960
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-10-05 22:22:12 +00:00
Ryan Macnak 8434b038fc Do not run service tests with obfuscation.
Change-Id: I046bd3ab6e3b819fd0087e73983d9fd834d5151b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166123
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-05 21:59:52 +00:00
Johnni Winther 28c6ab316d [cfe] Report errors on incompatible getter/setter types
Closes #42702

Change-Id: I9af4b8d616c4368c9f955f658f27e581352a3cd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165806
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-05 21:53:42 +00:00
Ryan Macnak 63206926fd [vm] Set exactly the correct set of base objects before writing a snapshot instead of leaving associations from all previously written snapshots.
For the main program snapshot, this has no effect. For secondary loading unit snapshots, this ensures they only reference their own objects or objects from parents and not objects from siblings that were written earlier.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ia7c5bec3b0c66564685ed2fd1b2bec52d2459024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163460
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-05 21:28:52 +00:00