Commit graph

97606 commits

Author SHA1 Message Date
Konstantin Shcheglov 9b196e5765 Remove isDartCoreFunction check from addSuperinterfaces().
It cannot happen, we remove invalid types during linking.

Change-Id: I9585a7bbe1f9c27cf029457bcd4221d46d509ccd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330948
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-18 15:42:59 +00:00
Chloe Stefantsova ffd43b214e [cfe] Report errors on zero or more than one representation fields
Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: I1009241a0a09a92c0e5b22b3848482b87392a72b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331061
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-10-18 14:54:25 +00:00
Tess Strickland c67f324cef [vm/compiler] Specialize ~/ by a power of two on 32-bit architectures.
Currently on 32-bit architectures, we only specialize truncating
division when the divisor is 1 or -1. That means all other cases
must go to runtime.

However, there is a general, non-branching computation for truncating
division when the absolute value of the divisor is a power of two,
so replace the call with that computation when appropriate.

TEST=language/div_mod, language/vm/modtruncdiv_int

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try
Change-Id: I279565633b03d1e16c02200a96fd6ffef8798741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331041
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-18 14:49:54 +00:00
Ryan Macnak 846654fca4 [test_runner] Account for cross builds from ARM64.
Change-Id: I382f25375f097066b6f3b0836da6871b993ca62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330942
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-18 14:32:16 +00:00
Daco Harkes 243cf59776 [vm] Object pool SnapshotBehavior for bootstrapping native functions
`NativeCallInstr::EmitNativeCode` `link_lazily` code path uses the
new snapshotting behavior, and the non-`link_lazily` checks that it's
never snapshotted.

The snapshot behavior argument is threaded from the the EmitNativeCode
to the places where the pool entry is constructed.

Does not yet migrate `kSwitchableCallMissEntryPoint` and
`kMegamorphicCallEntryPoint`.

TEST=CI

Change-Id: I8dd1dc5aa525f888b493856c60ae385087463d02
Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-simriscv64-try,vm-aot-linux-release-arm64-try,vm-aot-android-release-arm64c-try,vm-aot-win-debug-arm64-try,vm-aot-mac-product-arm64-try,vm-mac-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-ffi-qemu-linux-release-arm-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328861
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-18 13:27:26 +00:00
Vyacheslav Egorov 35b3f65088 [vm/arm64] Remove redundant LoadDImmediate
TEST=mentally tested it

Change-Id: Iffcdccac07054601719124d902adf2207e274545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331044
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-10-18 13:25:00 +00:00
Chloe Stefantsova be36f24d90 [cfe] Report error on representation type modifiers and missing type
This CL addresses some of the failures reported in
https://github.com/dart-lang/sdk/issues/53074

Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: I2b23a9d0c095856139563f9e500e88bebadc1ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331042
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-18 11:15:05 +00:00
Chloe Stefantsova 871d0b1b71 [cfe] Update UP for the case of extension and interface types
Change-Id: I968cc9c8ab38c944716c1a5f392e8cc4a732c1b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330801
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-18 10:37:32 +00:00
Slava Egorov 425a42e3be Revert "[vm, gc] Mark through new-space."
This reverts commit 5daaa7d9eb.

Reason for revert: internal crashes

Original change's description:
> [vm, gc] Mark through new-space.
>
>   - Initial and final marking no longer visit all of new-space, reducing the STW pause for major GC.
>   - A scavenge during concurrent marking must forward / filter objects in the marking worklist that are moved / collected, increasing the STW pause for minor GC.
>   - Unreachable intergenerational cycles and weak references are collected in the next mark-sweep instead of first requiring enough scavenges to promote the whole cycle or weak target into old-space.
>   - Artificial minor GCs are no longer needed to avoid memory leaks from back-to-back major GCs.
>   - reachabilityBarrier is now just a count of major GCs.
>
> TEST=ci
> Change-Id: I4a6a23273d8ecb78c640f054731d4ceb737bfc4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325840
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Change-Id: I8a50074db343c63c14f0487ae8b4f5fee2c4ae76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330720
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-10-18 07:47:39 +00:00
Alexander Thomas b2a158cc43 [frontend_server] Cleanup license headers
Bug: b/286184681
Change-Id: Ia203b87fecf17903b46bf929b22d3667b6ec2d59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330785
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-10-18 06:59:38 +00:00
Alexander Thomas 48cc894e1c [cfe] Fix incorrect license header
Bug: b/286184681
Change-Id: I3eba25d9d18131da4cadac90d164f3f756c213eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330802
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-10-18 06:58:48 +00:00
Ömer Sinan Ağacan ce9e332bb1 [dart2wasm] Make typed data implementation classes internally public
This is a part of [1] and a continuation of [2].

- Make typed data implementation file a library, to allow importing it
  in `dart:convert` patch.

- Make SIMD implementation file a library, to allow importing it from
  the typed data library.

- Make typed data implementation classes internally public (available in
  other `dart:...` libraries).

- Relax `mayDefineRestrictedType` to allow implementing restricted types
  anywhere in the standard library implementation.

[1]: https://dart-review.googlesource.com/c/sdk/+/330121
[2]: https://dart-review.googlesource.com/c/sdk/+/330781

Change-Id: I70bc6869a20fd2479bee081cfceef27d6de19974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330783
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
2023-10-18 06:40:49 +00:00
Ömer Sinan Ağacan 555e965bb1 [dart2wasm] Duplicate VM's convert patch for dart2wasm targets
This copies VM's convert implementation in dart2wasm's default and JSCM
targets, to be able to optimize the implementation based on these
targets' typed data and string implementation classes.

An example optimization that specializes UTF-8 decoder to `_U8List` can
be seen in [1], which improves a real-world benchmark (extracted from
internal) from 220ms to 90ms. (-59%)

Another optimization is we will be using the browser's UTF8 and JSON
decoders in JSCM convert patch.

VM's convert patch is moved from vm_shared to vm, as it's no longer used
outside of VM.

[1]: https://dart-review.googlesource.com/c/sdk/+/330121

Tested: existing tests.
Change-Id: I981070615a106e4f356ed8b292a29ec950bd4d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330781
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-10-18 06:39:59 +00:00
Sam Rawlins e61055abf0 analyzer: Fix yield assignability logic
The previous logic shortcutted the actual logic specified by the spec,
which introduced this bug. The shortcutted logic would ask "is
Iterable<dynamic> assignable to Iterable<int>?" which is "no."

This new logic separates the assignability calculation for yield* vs
yield statements.

Fixed: https://github.com/dart-lang/sdk/issues/53731
Change-Id: Ifd13c6b41b781167664de4e236583dc2b68f16a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330946
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-10-18 05:16:34 +00:00
Konstantin Shcheglov e4dfda311b Extension type. Issue 53725. Use representationTypeErasure of the matched type.
Bug: https://github.com/dart-lang/sdk/issues/53725
Change-Id: Ia9ea1b964288f05a19b23562a5c1e08e8dff5aa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330981
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-18 02:51:38 +00:00
Konstantin Shcheglov b7591ed0a2 Update fieldNameNonPromotabilityInfo storing, element tests.
Change-Id: I9b0a87f5413084e8905c86175d2843e5bdad1633
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330947
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-18 02:50:19 +00:00
Ryan Macnak c0a936868b [vm, ffi] Round up checking for registers for small structs.
This fixes an edge case on all ARM64 ABIs, when there is only one argument register remaining and the next argument is a 9-16 byte struct.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52644
Change-Id: I40d962e6d1b3484dbfcf91f5d6baca0bfec76056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330161
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-17 23:01:17 +00:00
Brian Quinlan b04c5a433e Adds tests and documentation for print line ending behavior
Bug:https://github.com/dart-lang/sdk/issues/53161
Change-Id: I3f13af3cb852b3656341922b9656ec91fc413eed
Tested: documentation + unit test only
CoreLibraryReviewExempt: Only adds documentation and adds a unit test to verify existing behavior
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323426
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-17 22:10:38 +00:00
Konstantin Shcheglov f81c232c4a Extension type. Support in LUB.
Change-Id: I79db0fd6223ad05d9f3ad2f7602a7c1155ad0c4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330900
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-17 21:40:19 +00:00
Konstantin Shcheglov cf447c583b Issue 53679. Support for RecordType in TOP_MERGE.
Bug: https://github.com/dart-lang/sdk/issues/53679
Change-Id: I948188a0f3d00ec46527a8d600c79da255e5e99f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330943
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-10-17 20:34:09 +00:00
Ryan Macnak 0685b34c88 [vm] Fail describing error if VMO operations fail for a reason other than no memory.
Cf. 78732b243e

TEST=remove VmexResource
Change-Id: I05604f34c37ad50e42d3adfa9d9d6ac1feb22cac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330940
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-10-17 20:32:52 +00:00
Vyacheslav Egorov aa893870df [dart2js] Disable Timeline is performance.measure is absent
Change d8 preamble to remove performance.measure entirely.

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

Change-Id: I4588e08e9126a0d0f8010f7a7786484da876bc85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330110
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-10-17 20:23:43 +00:00
Sam Rawlins 20dae1a3f6 linter: catch fields referenced in a pattern field
Fixes https://github.com/dart-lang/sdk/issues/53674

Change-Id: I87effd3cc4b3d3227cd26c3fdeb68b7f7e2d0ca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330880
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-10-17 19:54:48 +00:00
Brian Quinlan becd3e396c [io] Make _HttpDetachedIncoming fields private
Change-Id: If1253a21613f2ea2baa69c68f0999b56e5181322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330703
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-17 18:37:15 +00:00
Ryan Macnak 339d16e8b1 [infra] Skip unnecessary build step for QEMU RISCV64.
Change-Id: Ib7bef7aa9e0f4b76815749268c4990393a2342b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330686
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-17 18:07:23 +00:00
Ben Konyi 55eecf9777 [ package:vm_service ] Skip some DevFS tests on Windows
Fixes https://github.com/dart-lang/sdk/issues/53773

Fixed: 53773
Change-Id: Ib10c75d1a703113dd135a51382343114d7a451ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330860
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-17 16:47:24 +00:00
Ryan Macnak 90d488b98e [build] Android RISCV64 using a Canary NDK.
Change-Id: I447941fd4eee0c1e4394b3ab5c0b9c36a7b4c257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330701
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-17 16:34:27 +00:00
Ryan Macnak 7369dcb401 [vm, ffi] Add tests related to small structs.
TEST=ci
Change-Id: Ib39ce80bb149db488fb7e9ea0e44f7e5da57f205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330481
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-17 16:24:48 +00:00
Tess Strickland 20b6843238 [vm/compiler] Convert more LoadUntagged -> LoadField.
Missed a couple of LoadUntaggeds for PointerBase.data in the graph
intrinsifier during 4d1bdaac.

Creates slots for ExternalOneByteString.external_data and
ExternalTwoByteString.external_data and uses LoadField with those slots
instead of LoadUntagged.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/42072
Fixes: https://github.com/dart-lang/sdk/issues/53124
Change-Id: I900281644c4c42ad303cc7a6121e4c8bb7852cfe
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330787
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-17 16:14:29 +00:00
Sam Rawlins 1b4ae5a7e1 Refer to unnamed constructors in doc comments with '.new'
Cleanup for https://github.com/dart-lang/dartdoc/issues/3531

This makes these comment references more idiomatic, I think
more readable, and supports dropping the leading `new ` syntax
in doc comments.

Change-Id: Id832ad14d9ea08fe03fe3125065755f49b1b93ed
CoreLibraryReviewExempt: doc comment only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330683
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-10-17 14:42:38 +00:00
Tess Strickland f303110aa1 [pkg/vm] Also check -Dtest_runner.configuration for arch-specific tests.
Add RISCV32 to the list of architectures checked for
is32BitConfiguration.

TEST=vm/dart/pointer_as_typed_list_il_test on android trybots

Issue: https://github.com/dart-lang/sdk/issues/53774

Change-Id: I0c8297dc863b6121f9b1eafb99ae273ea2d0b34e
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm_x64-try,vm-aot-android-release-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330740
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-17 14:16:40 +00:00
Alexander Markov c9b28eb882 [vm/aot/tfa] Handle references to tree-shaken closures
Sometimes inferred closure value may reference a closure
which was eliminated by the tree shaker (as tree-shaker can prune
deeper AST). That should not cause a crash and inferred closure value
should be disregarded.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/eliminated_closure.dart
Fixes b/305730721

Change-Id: Ia26e620ebc06f949be1e05c734be65ce1d708b64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330661
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-17 12:14:18 +00:00
Martin Kustermann c8a782fdea [vm] Ensure the standalone embedder (aka dart) passes --link_natives_lazily in AppJIT
The `gen_snapshot` binary passes `--link_natives_lazily` if
it generates AppJIT/AOT snapshots (see `runtime/bin/gen_snapshot.cc`)

=> The `dart` binary should do so as well.

TEST=ci

Change-Id: I88d69f73a38cb23d4f7482739e2e0fda3c65ecef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330760
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-17 12:10:18 +00:00
Chloe Stefantsova e4bb5b608b [cfe] Use exhaustive switch in findTypeArgumentsIssues
This will allow to detect unhandled types statically.

The opportunity for the improvement was spotted while working on
https://dart-review.googlesource.com/c/sdk/+/312264

Change-Id: Ie39f48833be4d0f9f65a14e58f42843cc49c8fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330424
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-17 10:28:23 +00:00
Chloe Stefantsova c658b463f4 [cfe] Update UP for the case of two extension types
Closes https://github.com/dart-lang/sdk/issues/53290
Closes https://github.com/dart-lang/sdk/issues/53730

Change-Id: Ic3b720898b5877e3ab122cb904f0e9dbb9c63caa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330422
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-17 09:38:26 +00:00
Tess Strickland 4d1bdaaca9 Reland "[vm/compiler] Change MemoryCopy to also take untagged addresses."
This is a reland of commit 06d7a2352e

This version fixes an issue when a phi node has multiple inputs with
different unboxed integer representations. The original CL made a
change where only the representations were considered, not the range
of values for the Phi calculated by range analysis. The reland goes
back to the old behavior for this case.

Also fixes the new tests on 32-bit architectures.

Original change's description:
> [vm/compiler] Change MemoryCopy to also take untagged addresses.
>
> This CL adds the ability to pass the payload address of the source
> and destination directly to the MemoryCopy instruction as an untagged
> value.
>
> The new translation of the _TypedListBase._memMoveN methods use the new
> MemoryCopy constructor, retrieving the untagged value of the data field
> of both the source and destination. This way, if inlining exposes the
> allocation of the object from which the data field is being retrieved,
> then allocation sinking can remove the intermediate allocation if there
> are no escaping uses of the object.
>
> Since Pointer.asTypedList allocates such ExternalTypedData objects,
> this CL makes that method inlined if at all possible, which removes
> the intermediate allocation if the only use of the TypedData object
> is to call setRange for memory copying purposes.
>
> This CL also separates unboxed native slots into two groups: those
> that contain untagged addresses and those that do not. The former
> group now have the kUntagged representation, which mimics the old
> use of LoadUntagged for the PointerBase data field and also ensures
> that any arithmetic operations on untagged addresses must first be
> explicitly converted to an unboxed integer and then explicitly converted
> back to untagged before being stored in a slot that contains untagged
> addresses.
>
> When a unboxed native slot that contains untagged addresses is defined,
> the definition also includes a boolean which represents whether
> addresses that may be moved by the GC can be stored in this slot or not.
> The redundancy eliminator uses this to decide whether it is safe to
> eliminate a duplicate load, replace a load with the value originally
> stored in the slot, or lift a load out of a loop.
>
> In particular, the PointerBase data field may contain GC-moveable
> addresses, but only for internal TypedData objects and views, not
> for external TypedData objects or Pointers. To allow load optimizations
> involving the latter, the LoadField and StoreField instructions now
> take boolean flags for whether loads or stores from the slot are
> guaranteed to not be GC-moveable, to override the information from
> the slot argument.
>
> Notable benchmark changes on x64 (similar for other archs unless noted):
>
> JIT:
> * FfiMemory.PointerPointer: 250.7%
> * FfiStructCopy.Copy1Bytes: -26.73% (only x64)
> * FfiStructCopy.Copy32Bytes: -25.18% (only x64)
> * MemoryCopy.64.setRange.Pointer.Uint8: 19.36%
> * MemoryCopy.64.setRange.Pointer.Double: 18.96%
> * MemoryCopy.8.setRange.Pointer.Double: 17.59%
> * MemoryCopy.8.setRange.Pointer.Uint8: 19.46%
>
> AOT:
> * FfiMemory.PointerPointer: 323.5%
> * FfiStruct.FieldLoadStore: 483.3%
> * FileIO_readwrite_64kb: 15.39%
> * FileIO_readwrite_512kb (Intel Xeon): 46.22%
> * MemoryCopy.512.setRange.Pointer.Uint8: 35.20%
> * MemoryCopy.64.setRange.Pointer.Uint8: 55.40%
> * MemoryCopy.512.setRange.Pointer.Double: 29.45%
> * MemoryCopy.64.setRange.Pointer.Double: 60.37%
> * MemoryCopy.8.setRange.Pointer.Double: 59.54%
> * MemoryCopy.8.setRange.Pointer.Uint8: 55.40%
> * FfiStructCopy.Copy32Bytes: 398.3%
> * FfiStructCopy.Copy1Bytes: 1233%
>
> TEST=vm/dart/address_local_pointer, vm/dart/pointer_as_typed_list
>
> Issue: https://github.com/dart-lang/sdk/issues/42072
> Fixes: https://github.com/dart-lang/sdk/issues/53124
>
> Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-arm-try,vm-eager-optimization-linux-release-x64-try,vm-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try
> Change-Id: I563e0bfac5b1ac6cf1111649934067c12891b631
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324820
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TEST=vm/dart/address_local_pointer, vm/dart/pointer_as_typed_list

Issue: https://github.com/dart-lang/sdk/issues/42072
Fixes: https://github.com/dart-lang/sdk/issues/53124

Change-Id: Iabb0e910f12636d0ff51e711c8c9c98ad40e5811
Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-arm-try,vm-eager-optimization-linux-release-x64-try,vm-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330600
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-17 07:41:49 +00:00
Danny Tuppeny 6489835d8c Enable "Import Library" fix for comment_references lint
Fixes https://github.com/Dart-Code/Dart-Code/issues/4792

Change-Id: I8f03c9bed032b52c2bcbf86b43abf74343f2b7df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330640
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-17 03:39:47 +00:00
Liam Appelbe 9308e6bd01 [vm/ffi] Address Lasse's post-submit comments from 328280
https://dart-review.googlesource.com/c/sdk/+/328280

1) Combine _setKeepIsolateAlive/_getKeepIsolateAlive into
abstract bool _keepIsolateAlive.

2) Refactor close to delegate to _close, rather than calling
super.close(). Makes _isClosed validation clearer.

Change-Id: I61a97f5ba35c3ff00ab4270b9f7a763968e703fc
TEST=CI (no behaviour changes)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330580
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-10-17 01:54:00 +00:00
Devon Carew 78debcca27 [deps] rev file, http, native, sse, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

file (a18ad1c..7418131):
  7418131  2023-10-11  Parker Lougheed  Remove now unnecessary glob dependency override (#226)

http (88ec75e..7240d0a):
  7240d0a  2023-10-11  Brian Quinlan  Remove obsolete pigeon-generated file (#1032)
  827f4fe  2023-10-10  Brian Quinlan  Prepare to release cronet 0.4.0 (#1031)

native (22f4481..757f503):
  757f503  2023-10-16  Gabriel Terwesten  Use `Logger.detached` for test loggers (#158)

sse (e190744..37df57d):
  37df57d  2023-10-13  Kevin Moore  Enable and fix latest lints (#91)

test (4341470..ba050ae):
  ba050ae2  2023-10-13  Nate Bosch  Move functions to non-deprecated library (#2120)
  96e1ed2d  2023-10-13  Nate Bosch  Remove unused href field from error report (#2118)
  ae7f30e9  2023-10-13  Nate Bosch  Make compiler optional in calls to currentPlatform (#2117)

tools (92c5c15..ddeccf6):
  ddeccf6  2023-10-10  Elias Yishak  Handling malformed log items in log file (#175)

webdev (7c2c2d7..8d48d5e):
  8d48d5ea  2023-10-13  Ben Konyi  Bump package:vm_service to ^12.0.0 (#2248)
  9102b427  2023-10-13  Anna Gringauze  Add evaluation test to webdev to catch issues with runtime debugging API (#2250)
  63c7e728  2023-10-12  Elliott Brooks  Cider expects messages from a Chrome extension to be a JS object, not a string (#2249)
  a10bf10e  2023-10-11  Devon Carew  regenerate from the latest package:mono_repo (#2247)

Change-Id: I5c16c1387b613d1e6076579b26e6b64735097b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330662
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-10-17 01:16:16 +00:00
Konstantin Shcheglov 7f8b26639d Use InterfaceType directly in InterfaceLeastUpperBoundHelper.
Change-Id: I359ad5d3fae4f4237cb2d58b5d1a6d92dc034cfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-16 21:56:30 +00:00
Keerti Parthasarathy 9aca2789bb Add a method to BulkFixProcessor to compute changes to pubspec
Change-Id: I1c743df3780fea3f8cf930dad5085b4d2388fca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-10-16 21:54:25 +00:00
Sam Rawlins 279f6d77ae Bump dartdoc to 8c103397734f4dba75915e40c734a88e29a35f26
Change-Id: I3192bc00871d67b42721446ed54d00434f0df896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330666
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-10-16 21:43:11 +00:00
Danny Tuppeny 646b515d76 [analysis_server] Fix "switch expression" snippet showing up in wrong places
Fixes https://github.com/Dart-Code/Dart-Code/issues/4795

Change-Id: I6f74f538f91cc62cc8ae3ca2cfef4f77cccbc636
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330425
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-10-16 20:51:45 +00:00
Konstantin Shcheglov f4080e7ae3 Heap. Drop XyzLinkedData after reading.
All results
--------------------------------
flutter_elements
  reachableObjects
    count: 11774300
      change: -7.92% -1012105
    size: 951741119 = 929434 KB = 907.7 MB
      change: -4.48% -44650680 = -43604 KB = -42.6 MB
  _SimpleUri
    count: 3112
    size(shallow): 248960 = 243 KB
    duplicateCount: 0
  InterfaceTypeImpl
    count: 157899
      change: -0.01% -16
    size(shallow): 10105536 = 9868 KB = 9.6 MB
      change: -0.01% -1024 = -1 KB
  LinkedData
    count: 0
Change-Id: If98590f84d050c7c03d2a5e81d2e23353e7c02ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-10-16 20:51:02 +00:00
Konstantin Shcheglov 08c0108685 Extension type. Check getter/setter types correspondence.
Change-Id: Idcf1313f0119145fce23b2617ad03b4d852b54d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330663
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-16 20:43:42 +00:00
Danny Tuppeny e7eda9a4fc [analysis_server] Migrate a few more tests to TestCode from old markers
+ tweak indenting to be consistent with other tests.

Most of the larger test files are done with this change, and there are around 40 remaining calls to withoutMarkers() spread across around 20 files.

Change-Id: Icfa516f7ca869e09822442b02a1b2eafca692b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-16 20:42:59 +00:00
Alexander Aprelev f4d9c95262 [vm/dart2js] Add dart2js aot snapshot target to build scripts.
dart2js aot snapshot is used internally, so it makes sense to start building it externally to better understand its performance characteristics.
This CL doesn't add aot snapshot to dart sdk.

Change-Id: Id82a956138b118fb0a4bf0a16b1750e7bd4a801e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330664
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-10-16 19:23:09 +00:00
asiva e0fa7f9d0f [VM] Remove observatory_2 directory and all references to it.
TEST=ci

Change-Id: I4e95e59fc909c01517ae59f39d04c38bb353b85a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330525
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-10-16 17:45:46 +00:00
Sam Rawlins 312b46b444 Introduce first presubmit check for analyzer team.
See the issue below, and the code comments, for the further plans.
I plan on adding whichever ones we find useful, as long as I can
keep them performant. This one is performant, and we can discuss
possible problematic checks on the issue.

Work towards https://github.com/dart-lang/sdk/issues/53578

Change-Id: Ie3980e6194e46574a01ad3e0bd8e36f7ac248917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-16 16:42:24 +00:00
Chloe Stefantsova dfac967abf [cfe] Update comments on TypeParameterType
This CL removes the outdated comments hinting at the possibility of a
TypeParameterType object to represent an intersection type.

Change-Id: I5796f12bb22e9b21c3eb89c012abd6b6ebc75107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330601
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
2023-10-16 15:42:17 +00:00