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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
+ 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>
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>
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>
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>