Rationale:
Queries the constant of a shift operation to determine if it
is in range when range analysis has not run. This seems in general
a good idea, since some optimizations occur *after* range analysis,
and we were missing those cases. In this particular case, it also
avoids an assert fail on a shift by one without env() that was
introduced by a pass that has no subsequent range analysis. In
this case, it is unclear whether not having an env() was an
accident, or on purpose since the shift factor is known to
be well-behaved. Please have a careful look!
https://github.com/dart-lang/sdk/issues/36587
Change-Id: I12b4cb773f31899e17bfce8506bce599ccbef8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99382
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Currently, the VMO returned by `fdio_get_vmo_clone` is executable,
despite being documented as being read-only. We wish to correct
the implementation, but doing so would break anything that relies
on the implicit executability of that VMO.
To enable Fuchsia to make this transition, we should explicitly call
zx_vmo_replace_as_executable on the VMO holding the binary image we
wish to launch as a subprocess.
Change-Id: I040ed2409120a58a30e88ef34a01fe73434a7ea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99369
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Drew Fisher <zarvox@google.com>
The precompiler fails to traverse the delayed type arguments of a constant
closure for addition to the snapshot. The canonical bit of these type arguments
is therefore cleared in Precompiler::DropTypeArguments before the snapshot is
written.
The vm constant evaluator fails to canonicalize the delayed type arguments of a
constant closure.
This fixes issue 36500.
Change-Id: I3e336e5c8233e5b5233828a913ee66f7b1d4daef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99364
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Since evaluation of constant expressions now happens in the front end
the test coverage results are consistent irrespective of whether 'Force
compilation' is specified for coverage data or not in this test.
Adjusted the expectations accordingly.
This should fix https://github.com/dart-lang/sdk/issues/36600
Change-Id: I5392b255c6102d90b431f62e5fd92408fd706ace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99268
Reviewed-by: Alexander Aprelev <aam@google.com>
LoadOptimizer has a builtin alias-analysis which recognized only
Redefinition and AssertAssignable as instructions which must
be followed through when traversing use lists for a given
definition. However after recent changes CheckNull should be
treated the same way as these other two instructions.
This lead to incorrect computation of aliasing identity and
consequently incorrect load forwarding.
This change fixes this bug and also changes implementation of
OriginalDefinition in a way that makes aliasing analysis code
more future-proof.
We introduce virtual method Definition::RedefinedValue and
reimplement Definition::OriginalDefinition through RedefinedValue.
Aliasing analysis is changed to use RedefinedValue to detect
if an instruction is a redefinition.
Fixes https://github.com/flutter/flutter/issues/30619
Bug: https://github.com/flutter/flutter/issues/30619
Change-Id: I8019c93779491a4e6f127119d1d56eb037a3bb56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99170
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
It caused significant size increase due to having register spilling code
for every class allocation stub.
The helper method is called always in "tail" position and it is
therefore ok to clobber registers.
Change-Id: Ic2f19d740230282df1e399ea5009171f7713c837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99168
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The slow patch code of allocation stubs goes to runtime to allocate
objects/contexts/arrays. Those native calls seemingly guaranteed that
an object is new-or-remembered.
Though the runtime can actually allocate a new object and it can get
moved to old space right before returning to the continuation of slow
path allocation.
This causes us to have a newly allocated object which is not in the
remembered set.
This CL moves the code for "new-or-remembered guarantee" from
runtime_entry.cc to the call-sites in allocation stubs.
Issue https://github.com/dart-lang/sdk/issues/36369
Change-Id: Ieef9232b4c50fdd84ad81dd8f77697bf0c4775ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99143
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Given a graph like this:
v1 <- ... T{Foo?}
v2 <- v1.foo()
v3 <- v1.get:field()
We would constrain v1 after invocation - because call guarantees that v1 is
not null.
v1 <- ... T{Foo?}
v2 <- v1.foo()
v4 <- Redefinition(v1) T{Foo}
v3 <- v4.get:field()
Which past inlining can turn into something like
v1 <- ... T{Foo?}
CheckClass(v1, Foo) // Inserted by inlining
...
v4 <- Redefinition(v1 T{Foo}) T{Foo}
v3 <- v4.field
At this point v4 is redundant - because CheckClass above gives the same
guarantee and is movable. Which means we can lift LICM inhibition for v4.field.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try
Change-Id: I4b392ede071c41410a27288cae9bbc813a48cc99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99144
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This for instance allows the VM to include all patches
(e.g. the previously missing `runtime/lib/date_patch.dart`)
in what's returned from `LoadedScripts()`.
Over time this also allows for `LoadedScripts()` to be simplified and
become faster (it's currently something like O(m + m*n) where m is the
number of results in DictionaryIterator(*this) and n is the number of
returned scripts).
Change-Id: I4b5a6a0fe666b774fc0987d099ed02e81ac97b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
E.g. trying to set a breakpoint on the if in this code
```
if (args == null) {
print("was null");
}
// more code below
```
would actually set a breakpoint on the print, and the breakpoint - unless
the argument is null - would never be hit.
Change-Id: I072abb3bf2783e9f36c8d3ac6be4885ca454db94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98663
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Refactoring motivation: go/dart-simulated-ffi
* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants
* move methods that are only implemented by Location and not HostLocation out of Location
Change-Id: Ie9aa2dae63380da0cbfb15eacc440537fbed48f8
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-precomp-win-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98845
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
This reverts commit d79787771e.
Reason for revert:
This caused significant performance regressions on our protobuf_decode* benchmarks (probably on more benchmarks, but we don't yet have results due to some perf infra issue).
To avoid letting the regressions land for downstream users we'll revert it.
We should measure performance impact before landing this again.
Original change's description:
> [vm] Repair the resolver abstraction, take 2.
>
> - Move resolution logic that accumulated in the runtime entries into Resolver.
> - Improve NoSuchMethodError for closures when --no-lazy-dispatchers
> - Fix concurrent modification of Null class by nullability propagation.
>
> Change-Id: Ib05b431a289d847785032dda46e1bbcb524b7343
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98428
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,regis@google.com
Change-Id: I4f0f0a0d7c6018fc5968aafdce30f6d2e7495059
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99140
Reviewed-by: Martin Kustermann <kustermann@google.com>
A pc value of -1 marks an interpreter entry frame.
Preserving the argument count is not necessary.
VisitPointers now skips pc marker and fp in interpreted frames.
This fixes#36542.
Change-Id: Id752f16ecf08d5a882e44dd2b2aa9d86534b7b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98986
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
- Move resolution logic that accumulated in the runtime entries into Resolver.
- Improve NoSuchMethodError for closures when --no-lazy-dispatchers
- Fix concurrent modification of Null class by nullability propagation.
Change-Id: Ib05b431a289d847785032dda46e1bbcb524b7343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98428
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This is a temporary workaround for VM crashes when using observatory
in bytecode modes. Crashes heppen when CollectTokenPositionsFor
tries to access kernel AST (via kernel_offset()) but there isn't one.
Change-Id: I4c4dbb84653957c2f276f62216c12b58d2d666c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99084
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>