There was only one place that wasn't using a future with a zero length
duration, but that's now been fixed. I haven't been able to observe any
performance improvement from this change, but it does have the benefit
that the code is now consistent.
Change-Id: I232728ef2ef9a1000938d0117f611a96c17e9f38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435662
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Replace `getInheritedMap()` with v2 version.
Remove `getMember()`, operations should go thought elements, not types.
Remove `getMember2()`.
Rename v2 `getMember4()` into `getMember()`.
A few internal methods are duplicated for now, will be de-duplicated
when migration of InheritanceManager3 is finished. For now I'd like to
do smaller steps than migrating it fully.
Change-Id: Ib5d9d28e91d77330e41480fcb7176f93d867728a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435663
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
the nullability of `_indexOfReference()` formal parameter. It turns out that no code paths
ever pass null to it.
Also reuse _writeVariableGetterSetterLinking() for top-level variables.
Change-Id: Ia031ca5097fadaa28ea52a47fb18ebbc06d76c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435722
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Strictly speaking we do not promise the specific subtypes of
`Error` being thrown in the core libraries. The subtypes of
`Error` are there for better messages & debugging purposes.
Though some apps may rely on specific subtypes being thrown via
`try { ... } on IndexError {}`. So this CL changes our errors in
optimized mode to use the same `Error` subtype as in development
mode.
Though we do not expose details on the errors. Fields that expose
details will either return `null` or throw.
This makes various tests running under dart2wasm-minified mode
pass.
Issue https://github.com/dart-lang/sdk/issues/60397
Change-Id: Ie7be448b101473b18c2782457175ea163e71d5f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435783
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Freelist implementation was trying to mark pages executable (RX)
which does not respect possibility that it is working with RW mapping
which can't be directly marked as executable. It needed to use RO
permission instead if dual mapping is enabled.
This CL consolidates all code mentioning RX permission in one place:
VirtualMemory::WriteProtectCode so that we avoid this mistake in the future.
R=kustermann@google.com
TEST=tested by doing large reloads which cause more churn in code space
Change-Id: If99692cac3ce3ff54b907e4c43d7f26bae7439ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
- Make clear that you shouldn't do equality checks between a
Dart and JS value.
- Make clear you shouldn't use `is` with JS types.
- Remove mention of `as`, as that *may* be okay but is also the
only way to properly cast.
CoreLibraryReviewExempt: Doc-only change.
Change-Id: Ie4a8f22f9c44d740ddeddab55981475f0168d25e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434760
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This change reworks
`MemberDuplicateDefinitionVerifier._checkConflictingConstructorAndStatic`
and `MemberDuplicateDefinitionVerifier._checkDuplicateIdentifier` into
a form that is easier to reason about and has slightly faster
performance (measured by instruction count).
In the previous design, two maps were maintained for each scope in
which getters and setters might appear:
- one called `getterScope`, which (confusingly) held getters, setters,
and method declarations,
- and one called `setterScope` which only held setters.
This was difficult to reason about. In particular, it had a
longstanding bug that was only recently fixed (see
https://dart-review.googlesource.com/c/sdk/+/434061): if a setter was
encountered first, it was stored in `getterScope`, but if a getter was
encountered next, it was necessary to move the setter to `setterScope`
in order to store the getter in `getterScope`.
It was also inefficient, since in many cases, two map lookups were
needed in order to check for both getter and setter conflicts.
In the new design, there is a single map, whose values point to either
a `_ScopeEntryFragment` (in the case where just one declaration of the
given name has been seen) or a `_ScopeEntryGetterSetterPair` (in the
case where both a getter and a setter have been seen).
The new design has modestly better performance when measured by
front_end/tool/benchmarker.dart:
Comparing snapshot #1 (before.aot) with snapshot #2 (after.aot)
instructions:u: -0.0192% +/- 0.0131% (-6291379.67 +/- 4292101.91) (32692292436.33 -> 32686001056.67)
Change-Id: Ia6675fa4d3579779e6066db3760d2cc38a2c859e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435602
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Use-case: I have 20+ folders from the sdk that I have open
(front_end, _fe_analyzer_shared, vm, analyzer, analysis_server etc) and
before this CL that meant I had 20+ contexts, despite them having
`resolution: workspace` and being specified in the roots pubspec.yaml
under `workspace`. Opening, for instance, `pkg` directly would
successfully give me only 1 context, but also include lots of stuff I
don't want to clutter neither my screen nor my mind.
This CL merges such folders as possible meaning I with this CL only have
1 context.
* If not using the workspace resolution this should change nothing.
* If opening only the root of a workspace this should change nothing.
* If opening a sub folder that itself isn't a package (say `pkg` in the
sdk) this should change nothing.
Change-Id: Ia38fa6636b02fa95ed274ebf72d424cae7d4da66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434802
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Main changes:
1. Separating `FragmentBuilder` and `ElementBuilder`. I removed
`augmentation.dart` and its builders, because now it is implemented in
the new `ElementBuilder`.
2. Fragments are not given actual `Reference` objects anymore, there
might be some in the current state, but I will go over this in the
future and remove them completely.
3. Writing and reading elements also happens in two stages: first
fragments, then elements. Each fragment in the summary is given unique
ID, and during writing / reading elements we use these ID to locate
fragments and create elements around them.
4. Lazy loading of `ClassElement` members is simplified and generalized,
could be potentially applied to any `InstanceElement`. Maybe use also in
mixins, which are used somewhat often in Flutter.
5. There are slight changes to tests, mostly to the better, sometime a
bit reordering, a couple of new tests.
There is some dirty code added, especially around patching types for
getters, setters, and their fragments. I plan to clean this in future
CLs as I move toward better implementation, and from using fragments
where this is wrong.
Change-Id: I1e4bf2a3b7ff45f1dba133797e85cd70aa729c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This reverts commit c2095cb347.
Reason for revert: These changes are blocking the Dart SDK -> Flutter roll because they cause some Fuchsia tests to fail.
Original change's description:
> Reland "[VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization"
>
> This reverts commit d510876d9e.
>
> Reason for revert: g3 and Golem have been made compatible with this CL.
> See b/409535026 and
> https://chrome-internal-review.googlesource.com/c/golem/+/8345341.
>
> TEST=pkg/vm_service/test/failure_to_start_vm_service_after_vm_is_initialized_test,
> pkg/vm_service/test/failure_to_start_vm_service_during_vm_initialization_test
>
> Original change's description:
> > Revert "[VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization"
> >
> > This reverts commit 56ccf437e6.
> >
> > Reason for revert: b/409535026
> >
> > TEST=ci
> >
> > Original change's description:
> > > [VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization
> > >
> > > TEST=pkg/vm_service/test/failure_to_start_vm_service_after_vm_is_initialized_test,
> > > pkg/vm_service/test/failure_to_start_vm_service_during_vm_initialization_test
> > >
> > > Fixes: https://github.com/dart-lang/sdk/issues/60256
> > > Change-Id: I0543ab26e5721a4048136f27e8f4429bef04920f
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416300
> > > Commit-Queue: Derek Xu <derekx@google.com>
> > > Reviewed-by: Ben Konyi <bkonyi@google.com>
> >
> > Change-Id: I61eb42f0f00ad97e95e3ebf19990fe75d2d416aa
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421622
> > Reviewed-by: Derek Xu <derekx@google.com>
> > Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
>
> Change-Id: Ieba880b7b298e491055c3f6049bab6772b1f8aa3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434960
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I03b2371728de91e4e20008a879280c1ccab4d07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
* Disable RX workarounds on simulators: they cause host OS to crash;
* Remove Mac OS test for RX workarounds: it can cause host OS to crash;
* Remove old outdated code paths for OS versions that don't
need workarounds.
* Add code which detects whether workaround worked or not by intercepting EXC_BAD_ACCESS.
* Avoid using vm_remap in FFI callbacks when JITing, it does not work.
Instead restore old logic which manually copies page content, but adjust
FFI callbacks implementation to respect possible dual mapping.
This reworks changes done in commit
d194fcecaf after additional testing on a
wider range of hardware.
TEST=manually on physical devices and simulators
Change-Id: I339379386183c532fec25e88fa436ff0b970c2cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435120
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This adds [ConstructorEncodingStrategy] similar to
[PropertyEncodingStrategy] which allows for separating
[ConstructorDeclaration] from [ConstructorEncoding] such that we don't
need special [ConstructorDeclaration]s for extension (types).
Change-Id: I1c7f17e1759d47abae4af97d84455a37cbb70c17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435460
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>