There is a handy annotation designed just for this purpose.
Change-Id: I4a1e5e6320f6f3dd940ad43fc698a6ee41e6b44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134249
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Do not lock forwarding table during snapshot writing:
This is a follow-up to [0], which made the [WeakTable] used during
snapshot writing per isolate. Since each isolate has it's own table
now, there's not reason to lock it during snapshot writing.
Furthermore we speed up RawObject::InVMIsolateHeap() which was super slow
due to locking "vm-isolate"'s page space and walking all pages.
[0] https://dart-review.googlesource.com/c/sdk/+/114858
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I783ea6083c199058e76895fcde38dc06af6991d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134299
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This change breaks up the lengthy algorithm, and greatly speeds up the Relevance Analyzer tests.
Change-Id: I4273bcabe7399f80aa751c5963a53fa04e1b4d25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Change-Id: I265933f36f68df6f8e542a3f85ce0b04e1dfd549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134205
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
This makes a certain idiom using MultiFutureTracker more compact,
namely blocking on the completion of the closure.
Change-Id: I8872ce882da0b20775c416895047cc18abd2801a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134248
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Avoid calling Function::ToFullyQualifiedCString when it is not needed.
Change-Id: I7d8ed879bb47e5e06c456bec73e4e00ae0181cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134241
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This reverts commit 7475c637c3.
Reason for revert: Breakage on simarm_x64 (and thus arm_x64)
Original change's description:
> [vm/aot] Remove object wrapping of bare instructions for AOT snapshots.
>
> Now, when writing an AOT snapshot in bare instructions mode, only
> the actual instructions in the RawInstructions payload are serialized
> instead of the entire RawInstructions object.
>
> Since there are no longer RawInstructions objects in these AOT
> snapshots, we also change how Code objects are serialized. Instead
> of just containing a reference to the RawInstructions object, we
> serialize two pieces of information: where the instructions
> payload for this Code object begins and whether there was a single
> entry for the instructions payload. (To save space, the single
> entry bit is serialized as the low order bit of the unchecked
> offset, which was already being serialized).
>
> While we also need the length of the instructions payload, we
> approximate it for all but the last Code object by subtracting
> the next Code object's payload start from this Code object's
> payload start. For the last Code object, we assume it extends
> to the end of the instructions image.
>
> Changes on flutter gallery in release mode:
> armv7: instructions size -2.66%, total size -1.68%
> armv8: instructions size -5.81%, total size -3.49%
>
> Fixes https://github.com/dart-lang/sdk/issues/38451.
>
> Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,rmacnak@google.com,sstrickl@google.com
Change-Id: If2c8ca6b0993211b2509b275af7ff11a8fa2baa3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-simarm_x64-try, vm-kernel-precomp-android-release-arm64-try, vm-kernel-precomp-android-release-arm_x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134322
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
This reverts commit 30e80f0a64.
Reason for revert: Other failures were hiding under the ASSERT failure.
Original change's description:
> [gardening] Fix assert failure on (sim)arm_x64 due to 7475c63.
>
> Also since we write out a target word for the
> InstructionsSection::instructions_length_ field, make that field a
> uword, not a uint32_t.
>
> Change-Id: I8032cf49aae9528702778ee3ed717c08cb281e54
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-bare-linux-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134290
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,dacoharkes@google.com,sstrickl@google.com
Change-Id: I694411d9e986062148888aaddedc75673039dfe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try, vm-kernel-precomp-bare-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134321
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
This should fix the breakage in the NNBD on test standalone/io/issue_32052_test
Change-Id: I58192dffa9a9d7f5c492dd58e7f570fabcb69b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134243
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Fix the tests by disabling the optimisation that turns getter calls into
raw gets if the field is late, and by calling recording the null init
store in bytecode mode.
Change-Id: I8f12e3237cd32c890b5cef8d00c32940e937330d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134180
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Also since we write out a target word for the
InstructionsSection::instructions_length_ field, make that field a
uword, not a uint32_t.
Change-Id: I8032cf49aae9528702778ee3ed717c08cb281e54
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-bare-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134290
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: Ic1963eb1962bc1341a68783e9c44f3e04bfbc43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134223
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Change-Id: I71947bc5726f168fc036a7fece8a3b6b7bf964f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134224
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.
Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).
While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.
Changes on flutter gallery in release mode:
armv7: instructions size -2.66%, total size -1.68%
armv8: instructions size -5.81%, total size -3.49%
Fixes https://github.com/dart-lang/sdk/issues/38451.
Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I136befc5fa77bfa2a118f9bd032250abcde2da68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134222
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This CL updates the parsing of "break" statements in the debug console
in observatory, as well as handling that the same script can be a part
of several libraries.
Before one could get stuff like this:
$ break package:front_end/src/fasta/scope.dart:389
Function 'package:front_end/src/fasta/scope.dart:389' not found
$ break scope.dart:389
Script 'scope.dart' is ambiguous
The first one is fixes by this CL: We now allow package uris and thus
no longer think it's a function. In this case it wouldn't have mattered
though, it would just say it was ambiguous, as the last case.
This is caused by the same script being found twice. By using a set
instead of a list, that's fixed too.
Change-Id: I3931c8f2abc0a3a5a77cff516da8767037196bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133593
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
In the VM, a single script can belong to several libraries because of
mixins.
Previously, when setting a breakpoint, it found the function to set the
breakpoint in by taking the "scripts library" (script.FindLibrary) and
then tried to find a function in that library that matched.
Sometimes it found the "wrong" library and the breakpoint thus wasn't
set.
This CL changes that so it goes though all libraries, finds all maching
libraries and tries all of them.
This solves the issue at hand, but might not solve all corner-cases.
This added test demonstrates the resolved case where before it would
just say that it couldn't add the breakpoint on line 13.
Change-Id: Ie44b0dfb4ea3e8de767d1867ec432b2aef429b76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133592
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This is a preparation for landing the shared heap CL (it will
temporarily regress the isolate spawning time and memory use).
Once the shared heap CL is in, we can make a follow-up change to actually take
advantage of it by sharing the entire program structure (cl in
preparation by aam@). Once that lands we will enable the isolate groups
in AOT and reduce spawning latency by 10x :)
Regarding testing: We have already made all our isolate related tests in the
SDK run with/without isolate groups (irrespective of the default), so we
should continue to have test coverage in both modes.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ib7e5101dfe8527948cd9ceed09d50051b04fb874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134280
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
It is possible for an abstract member to be overridden with another
abstract member with different signature (that has, for example, more
optional parameters). In such cases, the noSuchMethod forwarders should
be generated for each distinct signature.
Closes#40248.
Bug: http://dartbug.com/40248
Change-Id: I7974415f0ecb78f05d7265ecf9d57cc0d38e6c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132661
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Some of the implicit casts were need for covariance checks. Now these
can be identified and actively preserved.
Change-Id: Ibfff4f68cc4af7956372adb2f4d846b079f0b508
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134162
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Something is weird with our ResourceProviders and Context.canonicalize.
It causes the following:
newFolder(convertPath("/p3"));
resourceProvider.getResource(convertPath("/p3")) is File; // false
resourceProvider.getResource(
context.canonicalize(convertPath("/p3"))) is File; // true
Change-Id: Iafbfb6ad1bfc912a6850faf063778879dc97fe62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134143
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
It is replaced with CorrectOverrideHelper.
Change-Id: Iab8162b9ffbca02000587ece1215717346b0a3a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134203
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The fuzzer found an issue where clamping negative zero would result in
conflicting answers depending on whether or not the clamp operation had
been optimized in JIT mode.
The MINPS and MAXPS instructions will always return the second operand
if the values being compared are -0 and 0, which is the opposite of what
the C implementation of clamp was doing.
Fixes https://github.com/dart-lang/sdk/issues/40426.
Change-Id: I3afb725bd0c8643758dbe753d863ba93c86ad747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134093
Reviewed-by: Alexander Markov <alexmarkov@google.com>
We need to be able to use TypeSystemImpl in DartObjectImpl.== to
call runtimeTypesEqual() instead of DartType.==
Change-Id: I2021a0d86a7c304072fd8fee2d1a7e6e979100a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134146
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This ensures that when type promotion happens while running the fix
builder, the promoted types are the correct post-migration types.
Change-Id: I15fe2cd8a6399527ded782dbbf252f9aeb530827
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134083
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
When adding a cast to a function expression like `() => null`, we need
to add parentheses, so that we produce `(() => null) as Type`, rather
than `() => null as Type`, which makes the cast appear to apply to the
function body expression.
Change-Id: Ib5ae93df5b840a832c10941e47fa092a4f764eea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134044
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>