Commit graph

85261 commits

Author SHA1 Message Date
Mark Zhou
a0b35de326 [dart2js] Moving runtime allocations to pkg:dart2js_runtime_metrics
* Stores runtime information on `$runtimeMetrics` instead of `$__dart_deferred_initializers__`
* Keys each app's runtime allocations onto self.runtimeMetrics.$currentScript

Change-Id: I6612fd2a5ac792bfcb7580ffe91d5391b80d5965
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242507
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-04-29 21:48:41 +00:00
Stephen Adams
f092184371 [dart2js] Migrate io/source_file.dart
Change-Id: Ic5c29160ed048ebce5ee48d05734096d9e451edb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243041
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-04-29 21:27:13 +00:00
Paul Berry
40632d7186 Ensure that parenthesized function literals are deferred too.
When a function literal is wrapped in parentheses, it shouldn't affect
how it interacts with type inference.  This change ensures that
parenthesized function literals are treated the same as
unparenthesized ones by the logic that supports
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.)

Change-Id: I672787a31addbfe3f3282b6e638e00b693eea46f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243000
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-29 20:35:51 +00:00
Aske Simon Christensen
c6a061f41d [dart2wasm] Implement set literals in the backend
Change-Id: I678a6c16248bfafce2e39c6c3e39505109250f35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242861
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-04-29 15:02:51 +00:00
Aske Simon Christensen
e31cc74d54 [dart2wasm] Fix some type errors in the for-in loop transformation
These errors don't affect code generation, but they produce invalid
kernel which can't be serialized, so fixing them is a prerequisite for
emitting a platform dill for dart2wasm.

Also run the kernel verifier on the post-TFA kernel when asserts are
enabled. Due to the TFA tree shaking, this has a relatively minuscule
effect on the run time of the compiler.

Change-Id: I6e7ae0e098703695bc85cddf11050f68f6cd0c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242545
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-04-29 15:02:51 +00:00
Aske Simon Christensen
28dec99cf5 [kernel] Allow bare return in sync* and async* functions in verifier
Such return statements are allowed in Dart, and they can be present in
kernel that has not been processed by the async transformation.

Change-Id: I8592cce58cb8fca2d78cdb0d5e5532715553c1ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242544
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-29 15:02:51 +00:00
Brian Wilkerson
f484e2e5db Remove some dead code related to handler domains
Change-Id: I4e96188349b726e144c5a799db5f019be7d809eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-29 13:34:33 +00:00
Alexander Thomas
d45ae603f7 [infra] Improve port selection for safaridriver
Bug: b/208186791
Cq-Include-Trybots: luci.dart.try:dart2js-strong-mac-x64-safari-try
Change-Id: I654ce8a60746c79d2922eebbda4cced822c821cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242871
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2022-04-29 12:55:41 +00:00
Sigmund Cherem
38438fb165 [benchmarks] update try_benchmark.sh script to include print_metrics
This configuration is used by some of our benchmarking bots
but it wasn't tested explicitly here.

Change-Id: I913b54863c10ededeff179b7cd1adee1577470a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242960
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2022-04-29 10:15:41 +00:00
Martin Kustermann
a9c1cb60d1 [gardening] Mark stacktrace-asserting tests as SkipByDesign in obfuscated/non-symbolic-dwarf mode
Issue https://github.com/dart-lang/sdk/issues/48907

TEST=Updates status file.

Change-Id: I4a80611fdd91eb44f082d429553ecc778fb407cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242866
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-04-29 09:57:41 +00:00
Alexander Thomas
11a6820f7c [infra] Use safaridriver to launch Safari
For some reason, we launched Safari from a file, which since macOS 10.14
requires the user to confirm the operation in a modal dialog which
caused timeouts.

* Removed unused http test driver port option.
* Added some basic tests for test.py's browser interactions.

Bug: b/208186791
Change-Id: I070529148d37bf312f219c576abca3da972f73e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204202
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-04-29 08:57:41 +00:00
Alexander Markov
c4c9dc5994 [vm] Enable new implementation of async/await in AOT mode
The new implementation results in a much smaller overhead of
async/await on AOT snapshot size. The savings depend on
how often async/await is used.

On a large Flutter app (customer: money)
AOT snapshot size -13.7% (arm64), -12.86% (arm)

Another large Flutter app
AOT snapshot size -8.69% (arm64).

Part 1 (kernel): https://dart-review.googlesource.com/c/sdk/+/241842
Part 2 (vm): https://dart-review.googlesource.com/c/sdk/+/242000

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: Idf99bb98725a1ffb21a15b111f03f5461ed2c9d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242384
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-04-29 01:03:50 +00:00
Alexander Markov
bf4bb95308 [vm] New async/await implementation in the VM, part 2 - vm
The new implementation moves away from desugaring of async
functions on kernel AST, state machine generated in the flow graph and
capturing all local variables in the context.

Instead, async/await is implemented using a few stubs
(InitSuspendableFunction, Suspend, Resume, Return and
AsyncExceptionHandler). The stubs are implemented in a
platform-independent way using (macro-)assembler helpers.
When suspending a function, its frame is copied into a SuspendState
object, and when resuming a function it is copied back onto the stack.
No extra code is generated for accessing local variables.
Callback closures are created lazily on the first await.

Design doc: go/compact-async-await.

Part 1 (kernel): https://dart-review.googlesource.com/c/sdk/+/241842

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: Ibad757035b7cc438ebdff80b460728b1d3eff1f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-04-29 01:03:50 +00:00
Ryan Macnak
fcc9169885 [vm, gc] Appease TSAN around racy access to IsolateGroup::active_mutators_.
Isolate may be entering or leaving the group while a scavenge is running and using the active mutator count to decide the size of the next to-space. A stale value seen by the scavenger only has performance implications rather than correctness implications, which will get fixed at the next scavenge.

TEST=iso-stress-linux
Bug: https://github.com/dart-lang/sdk/issues/48921
Change-Id: I171e5a460eadba3db6659dccda29c863549d27ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242925
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-28 23:27:20 +00:00
Ryan Macnak
72c153b930 [vm] Keep snapshot cursor etc in registers during ReadFill.
Startup.ReadProgramSnapshot(StartupTime): on a Moto x4
  arm32  37510 -> 35212 us (-6.13%)
  arm64c 45080 -> 42634 us (-5.42%)

TEST=ci
Change-Id: Ie97cf8cc1bd48a7ace16baded48d656224c5252b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242921
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-28 22:21:40 +00:00
Vyacheslav Egorov
dff2bce0b8 [vm] Avoid sentinel entry at the end of invocation_dispatcher_cache.
No code actually relies on it being there.

This saves ~1kb of snapshot size on a large Flutter application.

Related to https://github.com/dart-lang/sdk/issues/48910

TEST=ci

Change-Id: I03cf8811f39fc8882f7c650a79f01d350b520e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242863
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-04-28 21:45:00 +00:00
Vyacheslav Egorov
bd950da0a8 [vm] Avoid duplicate entries in invocation dispatcher cache.
We would add function itself to the invocation dispatcher cache
if the function itself can handle dynamic invocation.

However GetInvocationDispatcher will never be able to find this
entry because it looks specifically for functions with
kDynamicInvocationForwarder kind.

This lead us to add many duplicated entries to the cache.

The logic in the resolver does not actually need the cache to contain
the function because it falls through to lookup using unmangled name.

For a large Flutter application: before this change invocation dispatcher caches were contributing 129244 bytes to the snapshot, after this change they contribute 7764 bytes.

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

TEST=ci

Change-Id: I639d268e75fd43d2f4f0b1ea5a7873ba169f9d66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242862
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-04-28 21:43:10 +00:00
Konstantin Shcheglov
eb75f13c7a Run macro declarations phase.
Change-Id: I6f05cebd6274155e8dbb0bc60b17a9de6482196a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242924
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-28 21:25:00 +00:00
Stephen Adams
c50157e099 Support invoking JS operators through dart:js_util.
Some JS functionality is only exposed through operators, such as
implicit type conversions and BigInt arithmetic. Other than requiring
some minor additions for the exponentiation (`**`) operator, supporting
these through `dart:js_util` is trivial.

Change-Id: I010674303e4f99b42d43b73095de69b8ddcdeb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242680
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-28 21:18:40 +00:00
Ryan Macnak
3458b041df [vm] Avoid querying clocks for timeline recorders that don't take the timestamps as input.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48900
Change-Id: Idb689b07a8da1655535798bcd223460818a84c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242640
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-28 21:16:01 +00:00
Vyacheslav Egorov
6f24cbcb5c [vm] Drop Library::used_scripts in PRODUCT AOT mode.
This field is only used only by vm-service (including
hot reload and debugging), Kernel loading and mirrors.

So drop it to prevent putting it into the AOT snapshot.

Saves at 125Kb of snapshot size on large Flutter app.

Related to https://github.com/dart-lang/sdk/issues/48910

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Id7c47496e87482d462c2b318307f617d48758ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242864
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-04-28 20:45:40 +00:00
Liam Appelbe
738b142e59 Test that renaming file doesn't change modified time.
Looks like #36030 is already fixed, so this is just a regression test.

Bug: https://github.com/dart-lang/sdk/issues/36030
Change-Id: Idbb8e7ea473ec40225653398acc7863f89570b48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242760
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-04-28 19:57:52 +00:00
Stephen Adams
c8ad81e0c3 [dart2js] Move ParameterStructureMethods back to ParameterStructure
This cleans up the temporary splitting of ParameterStructure into two
libraries.

Change-Id: I475ed3dfc67da81c1f4bcc85c5660095d5457374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-28 19:57:43 +00:00
Stephen Adams
779f1341fd [dart2js] Migrate ir/{closure,constants,scope,scope_visitor}.dart
These libraries are a cycle.

Change-Id: I0d1145876dd4dc341c426de9dafd4a2ff817fd81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242780
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-28 19:49:41 +00:00
Paul Berry
3199e6548f Fix logic error causing all unnamed parameters have index 0.
In the definition of `_computeExplicitlyTypedParameterSet`, I
accidentally nested the declaration of `unnamedParameterIndex` inside
the `for` loop, defeating the increment and causing all parameters to
be considered to have index 0.

I've included a test case that would have caught the mistake.

Bug: https://github.com/dart-lang/language/issues/731
Change-Id: I0cd0e1e5b481313150e495d370af2477253d6637
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-04-28 17:14:50 +00:00
Paul Berry
08c60454c1 Defer analysis of closure arguments when inference-update-1 is enabled.
In order to address https://github.com/dart-lang/language/issues/731
(improved type inference for `fold` etc.) we're going to need to
sometimes defer analysis of invocation arguments that are closures, so
that closure parameters can have their types inferred based on other
parameters.  To avoid annoying the user with inconsistent behaviors,
we defer analysis of closures in all circumstances, even if it's not
necessary to do so for type inference purposes.

This has a minor user-visible effect: if an invocation contains some
closures and some non-closures, any demotions that happen due to write
captures in the closures are postponed until the end of the
invocation; this means that the write-captured variables remain
promoted for other invocation arguments, even if those arguments
appear after the closure.  This is safe because there is no way for
the closure to be called until after all of the other invocation
arguments are evaluated.  See the language tests in
tests/language/inference_update_1/write_capture_deferral_enabled_test.dart
for details.

Note that this change only has an effect when the experimental feature
`inference-update-1` is enabled.

Change-Id: If7bb38e361755180c033ecb2108fc4fffa7570b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241864
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-28 17:14:30 +00:00
Aleksey Kulikov
edb7fb4b1e docs(finalizer): fix typo
Closes https://github.com/dart-lang/sdk/pull/48916

GitOrigin-RevId: c95211d23ddbec8d807a026b699ab0a09713a6fd
Change-Id: Ic44b2bf80f4bb21056b5a671b6d047381928c87e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242900
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-04-28 15:18:41 +00:00
Ahmed Ashour
1586ac81a0 Fix typos
TEST=comment only change

Fixes #48853

Change-Id: I1fd47b8f186514af95a49ef253170045c584f970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241963
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-04-28 12:53:43 +00:00
Fritz Ammon
ca52d23a58 fix typo in zone documentation
fixing a typo; should be "or" as opposed to "of"

Closes https://github.com/dart-lang/sdk/pull/48743
https://github.com/dart-lang/sdk/pull/48743

GitOrigin-RevId: 72b612a080475c6280f9c4926bb330fb157cf54f
Change-Id: I048b416f1484e6390b71cab12a2d62307d3e8b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242782
Reviewed-by: Alexander Thomas <athom@google.com>
2022-04-28 11:28:17 +00:00
Jens Johansen
7ca259a978 [CFE] Skip import_package_by_file_uri when doing leak testing
In 64a169ec7e an incremental test -
import_package_by_file_uri - was added, which imports a file both via
its "file uri" and via its "package uri", resulting in "the same"
library existing twice. This also means that two libraries has the same
"file uri" which is what we search for when leak testing, meaning that
our weekly leak test failed.

This CL skips this test for leak testing as it by design will trigger
the situation the leak test looks for.

Change-Id: I85a9ac4e3f4dc19203955dbb1724402196c78fdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-04-28 10:49:31 +00:00
Jens Johansen
48574b06cb [CFE] Do equivalence test when fuzzing
Change-Id: If1afee9723df003f4a2cc39ab9db24e7c0c0cb93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242546
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
d68c796efd [CFE] Demonstrate changing error upon recompilation
Recompiling changes the given error from

```
Can't create typedef from non-function type.
```

to

```
Couldn't find constructor 'Bar'.
```

which does seem to make more sense when the code is `new Bar<int>()`.

http://dartbug.com/48897

Change-Id: I4d025fc2ec96f530b4d4b00aec18fab6a781710f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242543
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
a4d92fc170 [CFE] Demonstrate changing initializer (and wrong one on initial compile)
Seemingly caused by ordering of things in finishForwarders.

http://dartbug.com/48895

Change-Id: I605502d336f9f40dfc01245af436f09633d200a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
b2d509dc82 [CFE] Demonstrate changing nullability (on constant type) on recompile
FunctionNode.namedParameters[0]
      VariableDeclaration.initializer
       ConstantExpression.type
        InterfaceType.declaredNullability

changes from Nullability.legacy to Nullability.nonNullable.

http://dartbug.com/48894

Change-Id: Ic9e0ff3ea6c51d71d6073f8e37e1e96127414cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242446
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
da3015a44b [CFE] Demonstrate changing type on recompile #2
http://dartbug.com/48893

Change-Id: I5c8108379fff231d76d7c698a703a9185bc6aae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242445
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
a7ff623e6e [CFE] Demonstrate changing interfaceTargetReference via noSuchMethod on recompilation
http://dartbug.com/48892

Change-Id: I85dd6afdc2bb0eb0e04602666cbdf7be30b7e6ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242444
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
a477591467 [CFE] Demonstrate changing type on recompile
VariableDeclaration.type changes from InterfaceType(String?) to
FutureOrType(FutureOr<String>?) and the async transformation goes
from calling _completeWithNoFutureOnAsyncReturn to calling
_completeOnAsyncReturn upon recompilation with no change.

http://dartbug.com/48891

Change-Id: Ie28bcc37739742ccb33c033d7c7edff3f5b921e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242443
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
bd95cae6d5 [CFE] Demonstrate bugs wrt types pointing to TreeNodes
This demonstrates two things:
1) fileOffset changes because it goes to point from one file to another
    -- it doesn't specify the file of course --- and Constants shouldn't
   have fileOffsets in them at all.
2) Constant pointing to a type that points to a Typedef (which it
   shouldn't) which then again also changes upon recompilation.

http://dartbug.com/48890

Change-Id: If5f7ce56b3e95d92fc0c060002842325f9136146
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Jens Johansen
ce6d876892 [CFE] Incremental suite outputs expect file sooner
Change-Id: I2e151d356c2aa2d5345ecfcadb2a7105a4d1f9ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242451
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-04-28 09:03:54 +00:00
Konstantin Shcheglov
dd007c2c71 Check shouldExecute() before executing a phase.
Change-Id: Idc076b52e058d2144ef8e138379de34da44eb615
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-28 03:24:35 +00:00
Devon Carew
d7f102e041 [infra] improve the failure messages for generate_package_config.dart
Change-Id: I88e343f2817bf0aac9b67edc4e25d94a6517d99a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242383
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-27 23:00:45 +00:00
Konstantin Shcheglov
2f6c7e31df Parse 'agument' when 'macros' feature is enabled.
Bug: https://github.com/dart-lang/sdk/issues/48541
Change-Id: I01b6b5bb9062a1921e0e171419a9ec1349621d8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242660
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-04-27 20:38:37 +00:00
Nate Biggs
8033bb0fa0 [dart2js] Add interner for DartTypes.
This interner handles both Kernel DartType and the dart2js model.

Some samples of memory usage before and after this change (from linking/output phase):

Before: https://screenshot.googleplex.com/ctYKkApkrqaoHDg
After: https://screenshot.googleplex.com/4fyCXXNNUbyWSyu

Before: https://screenshot.googleplex.com/4nLYCQ6CkqdzgaQ
After: https://screenshot.googleplex.com/5N9btNjGbsdHpW3


Change-Id: I1b86bc1a134703259830a6ea31b4ccb10abaea8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241621
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-04-27 20:33:34 +00:00
Paul Berry
3203a0784a Additional tests for deferred function literals.
These tests exercise the "deferred type inference of function
literals" part of https://github.com/dart-lang/language/issues/731
(improved inference for fold etc.) for super-constructor invocations
and redirecting constructor invocations, both of which have their own
code paths in the analyzer.

Change-Id: I6877ac3c07a3cca31550ba74d941d250c8410cfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241987
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-04-27 20:30:35 +00:00
Alexander Markov
609ba96115 [vm] Fix assertion failure during class finalization
TEST=vm/dart/regress_48323_1_test

Issue: https://github.com/dart-lang/sdk/issues/48323
Change-Id: I50c04a269183c0df5b4ce0ce7be32cd2385e95d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242601
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-04-27 19:19:54 +00:00
Stephen Adams
d50e9e9355 [dart2js] Migrate ir/static_type_cache.dart
Change-Id: Ife640422d829cf7e74015876788df1c83e4df3ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242522
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-27 19:08:04 +00:00
Stephen Adams
4d9da00440 [dart2js] Migrate elements/types.dart to NNBD
- create a small 'facade' interface CommonElementsForDartTypes so that common/elements.dart can implement this interface to break the cycle between common/elements.dart and elements/types.dart

- Separate the tagging enums used into serialization into a separate 'tags.dart' library.

- Scattered hints to help the migration tool.

Change-Id: I8dbb993ebeb85f240392bafa53e4cc235825f63e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242506
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-27 19:05:44 +00:00
Aaron Clarke
904303f8a1 Made HashMap.update faster by reducing it to one lookup.
fixes https://github.com/dart-lang/sdk/issues/48866

Test=ci and golem

Change-Id: Ia56bd5b5de83dc8f7263eeda27e7abd3af42851e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242120
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-04-27 18:30:14 +00:00
Ryan Macnak
ad4126bba4 [vm, compiler] Use more compressed instructions on RISC-V.
dart2js.aot.rv64 25290024 -> 25042040 (-0.98%)
dart2js.aot.rv32 24466620 -> 24000012 (-1.91%)

TEST=ci
Change-Id: I0b60d0c3bd8df036426898e00cf650b398abb397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242065
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-04-27 17:11:35 +00:00
Ryan Macnak
5748add35c [vm] Use a big-endian encoding for snapshot ref ids.
When unconditionally adding in each byte, this causes the last-byte marker to appear in a constant position. The correction factor for each exit branch is the same, allowing it to be folded into subsequent load offsets.

Startup.ReadProgramSnapshot(StartupTime): on a Moto x4
  arm32  40456 -> 37414 us (-7.52%)
  arm64c 46012 -> 44457 us (-3.38%)

TEST=ci
Change-Id: Ie7fd69504f9d9edf0c17458281a3750931d7d97b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242392
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-27 16:08:19 +00:00