Gotta start somewhere.
All subject to revision. (Names especially.)
This gets us an end-to-end test and a starting point for client algorithm implementations.
Note that this was designed to run outside `test/`. We should be able to move it out if so desired.
Needless to say any thoughts on any of it are welcome!
Change-Id: Iecf5c7ce854f619aa5677454091ceb68dd45827b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134542
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
While a thread is outside a safepoint it should not perform any
long blocking operation and it must not acquire a Mutex/Monitor which
can be held while being inside a safepoint.
Right now we can have this situation
GC wants to safepoint
T1 is in a safepoint, acquires lock L and wants to leave safepoint (waits for GC to finish)
T2 is not in a safepoint and tries to acquire lock L
With this CL, we ensure to always transition to a safepoint before
performing Lock/Enter/Wait.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I79c55c79bfe828a319f5b035880f578ef62d913a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134323
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Now that typedefs are gone, unaliasing is a no-op.
Change-Id: I2fbe4555d06e11c12b1c1149af23a23e09df42b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Previously, if a function literal was used in a context where a
function returning non-null was expected, but the function literal
might return null, the migration tool inserted a cast that was
guaranteed to fail. Now it propagates non-null intent into the
function literal, so that the appropriate null checks happen inside
the function literal.
Change-Id: Ia62d18bc3b9955e84b09b846ea913607b305677d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134504
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reverts commit 1b959d6127.
Reason for revert: ASAN failures
Original change's description:
> [ VM / DartDev ] Added support for `format` and `pub` commands via standalone VM
>
> Initial work to allow for Dart snapshots to be executed based on a verb
> provided to the VM. Examples:
>
> - `dart format` === `dartfmt`
> - `dart pub run test` === `pub run test`
>
> Change-Id: I22c9c2ab6790b485395f1148419c517641f693ac
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133663
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=bkonyi@google.com,asiva@google.com
Change-Id: I35d9ff260e5f35f4e36b1e22ecf8b9dc1d2e3ed2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134564
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This CL extends ElementTypeProvider so that it also tracks type
parameter bounds. This allows the FixBuilder to reason correctly
about the what generic function types will look like after migration,
and that in turn prevents it from trying to add unnecessary casts.
Change-Id: I3c909a3b5ba14bf9f2aad4e58d0981c1b7b5bdd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134412
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
We now track decorated type parameter bounds similarly to how we track
ordinary type parameter bounds in the FixBuilder, by having a single
static instance of a DecoratedTypeParameterBounds class that keeps
track of the mapping.
Change-Id: I49196e8a506ca8765857b3d47a355b7aaaa1918e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134411
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The actual motivator is though that test_method was failing.
I suspect that this is a linter issue, `super.toString()`, when called
from legacy library and referencing NNBD SDK, is MethodMember, and
probably linter does not handle this right. I believe that this is
not a problem we should test or fix in analysis_server, so I update
the test to verify what is implemented in the server.
R=brianwilkerson@google.com, pquitslund@google.com
Change-Id: Iffe896deb138cd8f2da15ccf67a571491b544512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134406
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Initial work to allow for Dart snapshots to be executed based on a verb
provided to the VM. Examples:
- `dart format` === `dartfmt`
- `dart pub run test` === `pub run test`
Change-Id: I22c9c2ab6790b485395f1148419c517641f693ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133663
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This mostly copies the changes from DDC to the dart2js implementation.
Change-Id: Ib56b607a6cea3df0e319e32cd4afa6b5b55b03d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134463
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Mostly changes to the comment syntax, removing optional `new`, and using the
same kind of quotes on strings.
Change-Id: Ia6d7f38523312f67cfa30cd30cef994759d40ef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134480
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This reverts commit 37f4a44a27.
Reason for revert: Relanding after infra issues cleared
Original change's description:
> Revert "[ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs"
>
> This reverts commit 48808f7dce.
>
> Reason for revert: Unable to approve failures.
>
> Original change's description:
> > [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> >
> > Add support for naming VM service clients which allows for resume
> > permissions to be set for all clients of the same name. If a client
> > name requires resume approval, an isolate won't be resumed until all
> > clients which require resume approval have called the `resume` RPC.
> >
> > Resume approvals can be set for the following pause events:
> > - PauseOnStart
> > - PausePostRequest (issued after `reloadSources(pause: true)`)
> > - PauseOnExit
> >
> > Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Gary Roumanis <grouma@google.com>
>
> TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com
>
> Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com
Change-Id: Ibd9d831774e5c4dd500da026f41b173589a9aefd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134415
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Some of the tests were fairly seriously broken, so this fixes them.
Some of the tests were testing that we don't provide a fix when there is
no lint, but I don't think that it's useful to test that.
One test required no changes other than removing the marker.
Change-Id: I6d85fd98506fa20d8bf4996d30603feb8b1ff252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134500
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Report it as a silent exception. This way it will show up in log files
and (in the future) over crash reporting (since we haven't solved the
underlying cause), but *not* to users, because it currently appears to
be harmless.
In the future we should consider a "logged-only" type of exception, once
we are confident this isn't causing secondary issues, if we don't intend
to or think we are able to solve this at a deeper level.
Change-Id: I2ee339718fbd6e7c684ccc42718fbb57742f2dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134467
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Most benchmarks see speed improvements, especially the ones doing many
highly polymorphic calls. DeltaBlue on X64 is 35% faster.
ARM64 instructions size reduction on Flutter benchmarks ranges from
1.6% to 2.5% (0.7% to 1.2% on total size).
In terms of absolute numbers, the most significant size changes in the
Flutter Gallery snapshot are:
v7 before v7 after v7 diff v8 before v8 after v8 diff
Instructions 6034448 5964136 -70312 5880528 5740112 -140416
ObjectPool 139175 102704 -36471 141186 104720 -36466
UnlinkedCall 5795 3331 -2464 5795 3331 -2464
DispatchTable 0 48802 +48802 0 48796 +48796
CompressedStackMaps 410194 421222 +11028 461743 470841 +9098
Total 6589612 6540195 -49417 6489252 6367800 -121452
Change-Id: I78663b423c91ab105fc52a8e0bcb47eaf8cc57fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131833
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: If7029f8b42fd4b05cfb79eb439c09dc206dd3b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134328
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
99th percentile execution time is at 20s, so with twice as many results
we should still be well below the 60s timeout.
This should reduce the likelihood of lock contention on updating the
chunk count resulting in fewer builds failing to get test results.
Change-Id: I4eff0c854ca1fa091431d47017ce995110178e77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134331
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This reverts commit 4cd6243d77.
Reason for revert: Breaks anything using the bazel_worker package (which is used for modular compilation with build_runner). https://travis-ci.org/dart-lang/build/jobs/645748778
Original change's description:
> [dart:io] Backport semantic changes from the dart:io NNBD migration.
>
> The NNBD migration required making subtle changes to some dart:io
> semantics in order to provide a better API. This change backports these
> semantic changes to the unmigrated SDK so any issues can be discovered
> now instead of blocking the future SDK unfork.
>
> The Process class will now throw a StateError if the process is detached
> upon accessing the stdin, stdout, stderr, and exitCode getters.
>
> The Socket class will now throw a SocketException if the socket has been
> destroyed or upgraded to a secure socket upon setting or getting socket
> options.
>
> Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
> Commit-Queue: Jonas Termansen <sortie@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
TBR=sortie@google.com,lrn@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I744662fcd14ca232bf44a584bb6f3974d48da69a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134361
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Test that the NNBD implementation does not allow a nullable expression
where a non-null value is expected for language constructs.
Similarly that null-aware operations used on non=-nullable values
are caught.
Change-Id: I877e9b464666698b7f25b355b0474eb171bfc4b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134160
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Introduces NativeRepresentation and NativeLocation for the compilation of FFI.
NativeRepresentations are able to express all representations (or types) of the native ABIs we bind to with FFI, this is more representations that than that are used in Dart itself.
NativeLocations are able to express all locations of the native ABIs we bind to with FFI, this is more types of locations than that are used for the Dart calling convention.
See the documentation in the respective files.
These NativeLocations and NativeRepresentations are computed by the NativeCallingConvention and consumed by the Marshaller and Assemblers.
This reenginering is required for go/dart-ffi-by-value, hardfp (Arm S and D fpu registers), and iOS 64 bit (non-word-aligned stack arguments).
In addition, by using the NativeRepresentations we also get slightly reduced code size:
* The tracking of sizes is improved, so less sign/zero-extension operations are required.
* UnboxedWidthExtenderInstr is fully removed, the size extension is done inside the native moves, coalescing moves and size extension when possible.
* BitCastInstr is only used when really needed. This reduces code-size on arm32 softfp.
This fixes the iOS arm64 calling convention, manually tested with https://github.com/flutter/flutter/pull/46078 and https://dart-review.googlesource.com/c/sdk/+/131074.
Fixes: https://github.com/dart-lang/sdk/issues/39637
Issue: https://github.com/dart-lang/sdk/issues/36309
Issue: https://github.com/dart-lang/sdk/issues/36730
Change-Id: I8878bc0f314277bab4ca22f417c6295ecc017720
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129081
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>