Commit graph

86811 commits

Author SHA1 Message Date
Aske Simon Christensen 1638b75d77 Update d8 to 10.6.182
This version adds support for the `extern.externalize` and
`external.internalize` Wasm instructions.

Change-Id: I2285217feff0afa8107ec6685eeec91487667254
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255461
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen 02d1255d75 Update d8 to 10.6.166
The API for the JS Promise integration API has changed to be part of
the `new WebAssembly.Function` constructor. This requires parameter
types to be specified explicitly. Apparently, these types currently
must be all `externref`.

Change-Id: Ifae634f65cfa377441be4b2dc0643c34b702fbe7
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255061
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen b1c0992199 [dart2wasm] Implement the three-pronged WasmGC type hierarchy.
This splits the type hierarchy into three separate hierarchies with
the top types `any`, `func` and `extern`.

Update d8 to 10.6.91, which switches to the new type hierarchy.

Also, all ref shorthands for abstract heap types are now nullable, so
the type emitter in the `wasm_builder` is updated to follow that scheme.

To reduce confusion about the nullability of abstract reference types,
these now all require the nullability to be specified explicitly.

Change-Id: I4774d08cbed18307e481c466b2e3402a8d8fb6bd
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255060
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen bde8430b97 [dart2wasm] Initial async/await support based on Promise integration
This implementation has a number of limitations:

- Returning a Future from an async function is not supported.
- Every async call switches to a new stack. A later optimization will
  stay on the same stack if the call is directly awaited.
- Exceptions that cross async boundaries do not receive full stack
  traces including the async suspension points. The stack trace of the
  final exception just reflects the stack trace for the outermost
  async call.

Change-Id: I2a5d5e30d6e955999ba55842c8b2ca3427cbf954
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241010
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen 43e003ba04 Update d8 to 10.6.51
The Promise integration API has been updated to automatically
instantiate suspenders when an async export is called, which enables
the async/await implementation in dart2wasm to avoid a limited-size
stack pool.

Also, the --experimental-wasm-nn-locals options has been removed,
since non-nullable locals are now always enabled.

This is the last version before the (backwards-incompatible) change
over to the three-pronged WasmGC type hierarchy.

Change-Id: Ide164d83059877fa32f4ada9907290dd3d091b7a
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254924
Reviewed-by: William Hesse <whesse@google.com>
2022-08-19 07:11:18 +00:00
Jens Johansen 38e5b8f9e0 [parser] Parse Record Types
This is the first stab at implementing the record types from
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Change-Id: I15c07e05c32a95206d177521c5f2b7fed69b4fbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255244
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-19 07:04:44 +00:00
Ryan Macnak fef426ac0b Update clang and gn to match Fuchsia.
Begin using mac-arm64 toolchain instead of mac-x64 under Rosetta for non-Goma builds.

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=73385
Change-Id: I40f311dea1845b9abe11f28832582104cf43a4bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252867
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-08-19 06:21:44 +00:00
Konstantin Shcheglov 9663efd804 Write / read RecordType into summaries.
Change-Id: I90665fbb3bdc4307270a17d9cefa896d5f931f3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255762
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-19 05:12:54 +00:00
Kallen Tu add88f24c2 Eliminate dynamic calls to firstChild, remove and _innerHtml.
Change-Id: If984af54620727929ea8deb182226ce8d6514bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255581
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-08-18 21:50:14 +00:00
Nate Biggs 4b78f1b6c7 Reland "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit 0e1d24ae80.

Reason for revert: Interning bug fixed by https://dart-review.googlesource.com/c/sdk/+/255257

Original change's description:
> Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
>
> This reverts commit e833510bc5.
>
> Reason for revert: breaks many tests in G3, see b/242822389
>
> Original change's description:
> > [dart2js] Enable flag (canary -> shipping) to intern dart type values.
> >
> > Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Stephen Adams <sra@google.com>
>
> TBR=sra@google.com,natebiggs@google.com
>
> Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
> Reviewed-by: Ilya Yanok <yanok@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Ilya Yanok <yanok@google.com>

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

Change-Id: I51336c2e53dd58fed6216e9a5c818f05e8795a8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255663
Reviewed-by: Nate Biggs <natebiggs@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-18 21:30:54 +00:00
Alexander Markov 17311c94d1 Revert "[vm/compiler] Initial implementation of IL binary serialization"
This reverts commit 9700458975.

Reason for revert: breaks Dart SDK build using gcc and dart-sdk-linux-main bot.

Original change's description:
> [vm/compiler] Initial implementation of IL binary serialization
>
> This change adds binary serialization/deserialization of flow graphs.
> It supports all IL instructions and certain objects which can be
> referenced from IL instructions. IL binary serialization is a useful
> machanism which would allow us to split compilation into multiple parts
> in order to parallelize AOT compilation.
>
> The program structure (libraries/classes/functions/fields) is not
> serialized. It is assumed that reader and writer use the same
> program structure.
>
> Caveats:
> * FFI callbacks are not supported yet.
> * Closure functions are not re-created when reading flow graph.
> * Flow graph should be in SSA form (unoptimized flow graphs are not
>   supported).
> * JIT mode is not supported (serializer currently assumes lazy
>   linking of native methods and empty ICData).
>
> In order to test IL serialization, --test_il_serialization VM option is
> added to serialize and deserialize flow graph before generating code.
>
> TEST=vm/dart/splay_test now runs with --test_il_serialization.
>
> TEST=Manual run of vm-kernel-precomp-linux-debug-x64-try with
> --test_il_serialization enabled (only ffi tests failed).
>
> Issue: https://github.com/dart-lang/sdk/issues/43299
> Change-Id: I7bbfd9e3a301e00c9cfbffa06b8f1f6c78a78470
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254941
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com,rmacnak@google.com,alexmarkov@google.com

Change-Id: Iae4e4868f183815a8fc3cd79597141b3896e23d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/43299
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-08-18 20:46:34 +00:00
Brian Wilkerson ad223fd07f Resolve record literals
I'm reasonably confident that this is incomplete, but I'm hoping that
it's a least headed in the right direction.

There aren't any tests because I believe that our resolution tests are
all based on source code, and we can't yet parse record literals. I'm
happy to hold off on landing this CL until we have the parser work
landed and the AstBuilder updated so that I can have tests to go with
the changes.

Change-Id: I7cd2a9b3a2e496c1220d569b36497dc326ff6915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255146
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-18 20:29:19 +00:00
Ryan Macnak 4a621f5c48 [vm, compiler] Don't clobber R18 during CCallInstr on Fuchsia ARM64.
Cf. 5380fa5d40.

TEST=local
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=105336
Change-Id: Id025e40e6153570ee88f2daa47be6f12ff9b5822
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255548
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-08-18 20:28:26 +00:00
Paul Berry 1f3ff13d98 Reland "Migration: fix generate_resources.dart to use dart compile js."
This is a reland of commit 6abea1381b

Original change's description:
> Migration: fix generate_resources.dart to use `dart compile js`.
>
> This is necessary because the command `dart2js` is no longer present
> in the SDK.
>
> Change-Id: Iea3cf3092bcda6c889c55a51d1b5601773404fb9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253862
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

Change-Id: Ibc25641aca165b578b2c4348ef0b841263298e3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-18 20:21:17 +00:00
Konstantin Shcheglov 9d05e410ad Implement DOWN for RecordType.
Change-Id: I578e98de509ae6ded1d6a5618f75f0576ceef6a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255682
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 20:17:47 +00:00
Nate Biggs 61d7200840 [dart2js] Add == override to Dart2JS ir.InterfaceType subclasses.
These subtypes were previously colliding with instances of the base ir.InterfaceType class in the interner map.

Change-Id: Iec6b53fa82e0994142c408a0a2be1ddd045898e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255257
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-18 20:12:44 +00:00
Konstantin Shcheglov 66c09b2fd2 Update ReplacementVisitor to support RecordType.
Change-Id: I4ada89fc87709dd15f2add86005d6c8927d7b773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255684
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 20:09:44 +00:00
Konstantin Shcheglov 54bd737c30 Update RecursiveTypeVisitor to support RecordType(s).
Change-Id: Ic44d956040144fe56f12637527b49368371c3947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255683
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 19:50:44 +00:00
Joshua Litt 4810c8930b [dart2wasm] Initial regexp support.
Change-Id: Ia461c77979785bbc0510052a31f94bdd83babc01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250582
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-18 19:49:34 +00:00
Nate Biggs 7ddee84e78 [dart2js] Update SSA/Codegen inlining metrics.
Add several more inlining metrics to SSA:
- getters (ellisions vs. inlines)
- setters (ellisions vs. inlines)
- intercepted length calls
- if conditions
- is checks
- late sentinel checks

After digging these are all the opportunities for optimization that I saw that I thought might be affected by changes in global inference. Open to feedback on whether any of these are unnecessary or if there's any other things worth tracking.

Change-Id: I70ff279a797f71b39b2bc02c00fbb3f6e149cb2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255202
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-18 19:23:54 +00:00
Konstantin Shcheglov c9febdd4e3 Update display string for promoted type parameter type.
Bug: https://github.com/dart-lang/sdk/issues/49692
Change-Id: I4f61dfe9bb123f000cb253f14a0733063f16acde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255547
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 17:26:34 +00:00
Michael Richards 8d262e2944 [dartdev] This adds the ability for the Dart CLI to use the Resident Frontend Compiler for faster start times.
Dartdev will use the user's home directory to store the server information and will keep a directory for cached kernel files in each dart package's .dart_tool directory and in the .dart directory for stand alone dart programs.

This functionality is accessed by providing the --resident flag to the Dart CLI, and the server can be manually shutdown with the new shutdown command.

Change-Id: I5231a00b7535266ab0704ca3ae35c039738bd38b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254341
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-08-18 17:01:34 +00:00
Alexander Markov 9700458975 [vm/compiler] Initial implementation of IL binary serialization
This change adds binary serialization/deserialization of flow graphs.
It supports all IL instructions and certain objects which can be
referenced from IL instructions. IL binary serialization is a useful
machanism which would allow us to split compilation into multiple parts
in order to parallelize AOT compilation.

The program structure (libraries/classes/functions/fields) is not
serialized. It is assumed that reader and writer use the same
program structure.

Caveats:
* FFI callbacks are not supported yet.
* Closure functions are not re-created when reading flow graph.
* Flow graph should be in SSA form (unoptimized flow graphs are not
  supported).
* JIT mode is not supported (serializer currently assumes lazy
  linking of native methods and empty ICData).

In order to test IL serialization, --test_il_serialization VM option is
added to serialize and deserialize flow graph before generating code.

TEST=vm/dart/splay_test now runs with --test_il_serialization.

TEST=Manual run of vm-kernel-precomp-linux-debug-x64-try with
--test_il_serialization enabled (only ffi tests failed).

Issue: https://github.com/dart-lang/sdk/issues/43299
Change-Id: I7bbfd9e3a301e00c9cfbffa06b8f1f6c78a78470
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254941
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-08-18 16:53:24 +00:00
pq f4ea96ff2c [dartdev] fix --code support
See: https://github.com/dart-lang/sdk/issues/47219

I'll follow up with tests for error conditions once diagnostic codes are validated by the protocol (see: https://dart-review.googlesource.com/c/sdk/+/255541).

Change-Id: I3318364e952522522608e86bdfdd231839685689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255544
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-18 16:51:54 +00:00
pq 1b2644afd2 [bulk fix] report undefined diagnostics
Change-Id: I4abe1e83c56e632f91a81510ec0a35b521cd11d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-18 16:11:36 +00:00
Daco Harkes 7248456e69 [vm/ffi] update FfiNative nullptr receiver error message
TEST=pkg/vm/testcases/transformations/ffi/ffinative.dart

Bug: https://github.com/flutter/flutter/issues/109180
Change-Id: I53785c654f4699f4af5b4b686b76c621c2ddd778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255680
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-18 16:04:20 +00:00
Konstantin Shcheglov 05d01e79cc Highlight 'required' in SuperFormalParameter.
Change-Id: Ia25378e88eced277bb6242c8cea6bbf09dbb521a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-08-18 15:56:17 +00:00
Konstantin Shcheglov 5a9e007a5a Use DartType.element2 instead of 'element'.
We want to replace it in https://dart-review.googlesource.com/c/sdk/+/243164

Change-Id: If28020581b3e511ceb2bee59cf30d38be7f1308e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255584
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 15:56:14 +00:00
Michael Thomsen a23a6b250f Discontinue the non-null FFI sample.
Please refer to the null safety version:
https://github.com/dart-lang/sdk/tree/main/samples

Bug: none
Change-Id: I4db097842b35129f184516aa9ac5cd0e4d165092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255246
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-08-18 15:44:04 +00:00
Paul Berry 37ef55db8a Migration: add failing test to repro issue #49689
Bug: https://github.com/dart-lang/sdk/issues/49689
Change-Id: I00aaca8160b2bcd3de02eeb31ecc3efd6ec4a84c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255545
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-18 13:51:34 +00:00
Lasse R.H. Nielsen a5f25ee3ba Add Isolate.run.
Adds static method on `Isolate` to run an asynchronous function
in a separate isolate.

Change-Id: I673373fa02524f1d0b88099027cfaf1b796eb344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254960
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-08-18 10:42:55 +00:00
Ilya Yanok 9299aa216e Revert "[vm/compiler] Optimize switch statements"
This reverts commit f5228127f8.

Reason for revert: causes a VM crash, see b/242964932 (the test is also publicly available at 93fb0da38a/drift_dev/test/analyzer/sql_queries/query_analyzer_test.dart (L8))

Original change's description:
> [vm/compiler] Optimize switch statements
>
> Switch statements that either contain only integers or only enum values of the same type can be optimized.
>
> Depending on the number of switch expressions and the number of holes that the range of switch expressions contains, either a binary search or a jump table is used.
>
> TEST=runtime/test/vm/dart{,_2}/optimized_switch
> TEST=tests/language{,_2}/switch
>
> Fixes: https://github.com/dart-lang/sdk/issues/49585
>
> Co-authored-by: Gabriel Terwesten gabriel@terwesten.net
>
> Change-Id: I62dcdb7843107f03de7e468c60b4db52ec78f676
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253787
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,gabriel@terwesten.net

Change-Id: I8c673ea70e7ed91dffb3674e7dcb4aaa0611e978
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255258
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-08-18 10:10:54 +00:00
Chloe Stefantsova 1611fe6f45 [cfe] Separate out IntersectionType from TypeParameterType
TEST=Covered by existing tests

Change-Id: Ie7b99b1c109edff5198cfbf5d22e1cfb1dc130d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253665
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-08-18 08:47:29 +00:00
Alexander Markov c9bcbd3474 [vm/compiler] Reduce flow graph checks for common constants
This change disables certain debug mode checks for commonly used
constants which were enabled in https://dart-review.googlesource.com/c/sdk/+/253840.

It turns out they affect compilation time considerably in debug mode,
especially if low optimization threshold is used and kernel service
snapshot is not used (for example in debug/ia32 mode).

Time of running standalone_2/regress31114_test in debug/ia32 mode:
78s -> 34s.

TEST=CQ + a few debug bots
Fixes https://github.com/dart-lang/sdk/issues/49676

Change-Id: I9e09d6e5b9c1c86d9026a924a367301e0dac85b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255500
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-08-18 03:22:53 +00:00
Konstantin Shcheglov 78b5bb0ae2 Remove deprecated BazelWorkspace.
Change-Id: I656f3c906cdaeb2b7a5ab93c7ccde9693e9a9cba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255549
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-18 01:48:36 +00:00
Nate Biggs 8f5983b3c3 Revert "[dart2js] Defer deserialized CodegenResults by members."
This reverts commit a547cfc096.

Reason for revert: With 15 shards this ends up holding too much serialized data and causes an increase in memory usage.

Original change's description:
> [dart2js] Defer deserialized CodegenResults by members.
>
> For large applications only ~60% of these objects are used. This defers their deserializtion until they're accessed in the codegen member map.
>
> In local testing on large applications this saved ~200MB of memory usage in the linker phase.
>
> Change-Id: I8ff87803fc23ef2d3f954646687e3fc67b68a4f7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254600
> Commit-Queue: Nate Biggs <natebiggs@google.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>

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

Change-Id: I51d292531be30b358a025d7c472f25e8aba4dc3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255283
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-08-18 01:28:53 +00:00
Konstantin Shcheglov d65d3c1ca6 Add visitRecordElement() and friends.
Change-Id: I8323d6c34b27b15f2453642a8f3f64763798c071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255580
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-17 22:55:43 +00:00
Konstantin Shcheglov f15b6f24d2 Implement runtime type equality for record types.
Change-Id: I06a717fddcc8600afa39b4a33890415456eb3173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255546
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-17 22:49:23 +00:00
Konstantin Shcheglov 358dd8fd81 Write a stub for resolving record literals.
Change-Id: I5290a2f6eac8465257dc9eabb143ae8669da362c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255520
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-17 21:25:03 +00:00
Kallen Tu d0e27df1e3 Eliminate dynamic calls when getting the environment.
Statically type String variables to avoid dynamic calls for substring or concatenation.

Change-Id: If485243dc0580fd1f4e53ec4cf69cb3819a57b5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255301
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-08-17 21:00:23 +00:00
Gabriel Terwesten f5228127f8 [vm/compiler] Optimize switch statements
Switch statements that either contain only integers or only enum values of the same type can be optimized.

Depending on the number of switch expressions and the number of holes that the range of switch expressions contains, either a binary search or a jump table is used.

TEST=runtime/test/vm/dart{,_2}/optimized_switch
TEST=tests/language{,_2}/switch

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

Co-authored-by: Gabriel Terwesten gabriel@terwesten.net

Change-Id: I62dcdb7843107f03de7e468c60b4db52ec78f676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253787
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-08-17 18:00:43 +00:00
pq c4766b319a bulk fix support for specified diagnostics
Change-Id: Ifa98da5466b0efb1b88cfa17d06b6b4e1d4ba8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-17 17:50:03 +00:00
Paul Berry 53ed7a156a Migration: fix types of DecoratedType.{positional,named}Parameters
These fields can be `null`, but if they aren't, then the
`DecoratedType`s they contain cannot be `null`.

Change-Id: I9f07d06017ff9814e531f3517b4f452766dc0ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-17 17:32:04 +00:00
Konstantin Shcheglov dfcf1e8a79 Implement NORM for RecordType.
Also adds `RecordType.==` as equality of the shape and field types.
We intentionally don't check that elements are the same.

Change-Id: I4f5ef66a838a410843696f4f569ce3ed36bb7053
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255147
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-17 16:29:33 +00:00
Tess Strickland 00bd7ff339 [vm/test] Remove checked-in binaries from MachO test.
Instead of using checked-in binaries in snapshot_utils_test.cc,
write out the binaries manually and check the written binaries.

TEST=vm/cc/CanDetectMachOFiles

Issue: https://github.com/dart-lang/.allstar/issues/159

Change-Id: I024ecac2084cfaef6bf8fe2a7cecceb9ae5d8de9
Cq-Include-Trybots: luci.dart.try:vm-kernel-mac-release-arm64-try,vm-kernel-mac-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255460
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-08-17 16:18:35 +00:00
Alexander Biggs dca2025821 [errors] Fix typo in URI_DOES_NOT_EXIST message.
Change-Id: I2181d196da1c616d8f5cc4c76ea90360ea1b1259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255480
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-17 15:43:43 +00:00
Alexander Biggs 0de06163ce [analyzer] Fix bugs in generate_files script.
- task_dependency_graph no longer exists.
- summary/generate.dart expects an IDL file, it fails
  when run without any args. There's only one such
  file in the repo so I passed that.

Change-Id: I63854acc070c1cf4c49bb82d03f1312930e447e5
Tested: Ran the script, it generates all files without errors.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-17 15:43:13 +00:00
DEPS Autoroller 9558530baf Roll Dart Protobuf Support from 7edcdde795cd to 9cf05f6e9f53 (1 revision)
https://dart.googlesource.com/protobuf/+log/7edcdde795cd..9cf05f6e9f53

2022-08-17 vegorov@google.com Avoid hitting size limit when parsing request in protoc plugin (#734)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I682845ed4a8041901b9c82785860772eaa98accd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255420
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-08-17 14:31:03 +00:00
Bishwajeet Parhi 0a4c6a5cf4 Docs: Update broken link for Random.secure
Closes https://github.com/dart-lang/sdk/pull/49682

GitOrigin-RevId: 0a049389dd422e646036232282bbb23ea3bc805e
Change-Id: I39da72e4adb8365a608d53117c146d85ab459bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255381
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-08-17 13:24:43 +00:00
Ilya Yanok 0e1d24ae80 Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit e833510bc5.

Reason for revert: breaks many tests in G3, see b/242822389

Original change's description:
> [dart2js] Enable flag (canary -> shipping) to intern dart type values.
>
> Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

TBR=sra@google.com,natebiggs@google.com

Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
Reviewed-by: Ilya Yanok <yanok@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2022-08-17 12:29:03 +00:00