made in 0e5f3f49c3
Change-Id: Ic7e9a91512661d3a1999f933e9d6caab6db340a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220700
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
profiler events.
`Event.cpuSamples` is now a `CpuSamplesEvent` rather than a `CpuSamples`
object, where `CpuSamplesEvent` returns `(@Object|NativeFunction)[]` rather
than `(@Func|NativeFunction)[]`, resulting in a smaller JSON payload.
TEST=get_object_rpc_test.dart,get_cached_cpu_samples_test.dart
Change-Id: I1ad5e3df8840b8c41735d10c6c8669f6503e54a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219284
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
More precisely, ignore private constructors with no parameters, on
abstract classes with no subclasses, no non-static members, and no
non-static functions (other than the constructor).
This is an idiom used to make static utility classes, and these
constructors are not intended to be used. So counting them as coverage
misses incorrectly lowers the coverage percentage.
Fixes: https://github.com/dart-lang/sdk/issues/47021
TEST=Added unit test
Change-Id: Ib94dd939c4637d5c04fe45009fc92be435e164da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220225
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
When compiler generates 32-bit instructions with immediate operand
(such as add/sub etc) it expects to find 32-bit immediate value.
In compressed pointers mode Smi occupies 32 bits with unspecified
upper bits. So getting a raw value of a Smi using
static_cast<int64_t>(constant.ptr())
is not correct. For example it may yield 0xfffffffe instead of
0xfffffffffffffffe for -1 value.
This change fixes a few places in code generator to use Smi::RawValue
instead of doing a static_cast.
TEST=runtime/tests/vm/dart/regress_47704_test.dart
Fixes https://github.com/dart-lang/sdk/issues/47704
Change-Id: I1f649c5a22f221c7f4e69a884c88c265973be606
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220660
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Sync generators contain two implicit wrappers (:sync_op_gen
and :sync_op), which do not directly correspond to any user
code - and therefore do not have fileOffsets.
Some tools however rely on fileOffsets to e.g. compute code
coverage, so this change adds fileOffset inherited from the
non-synthetic code to :sync_op_gen and :sync_op.
Bug: https://github.com/dart-lang/sdk/issues/47681
Change-Id: I0c54bc3eaf5892e591fead845b5d31d2dfc9481f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220543
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
This change refactors CreateAndSetupDartDevIsolate slightly to
exit as soon as we know we cannot resolve DartDev.
Expands on the error message to be a bit more informative about
what went wrong.
Before:
Failed to start the Dart CLI isolate
(null).
Observatory server failed to start after 1 tries
[...]
After:
Failed to start the Dart CLI isolate. Could not resolve DartDev snapshot or kernel.
[...]
TEST=CQ
Change-Id: Iad3302dc4e64eef06b97c8b76a82b04c97a7089e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220546
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This allows the embedder to control the degree of parallelism and thread priorities.
TEST=engine
Bug: https://github.com/dart-lang/sdk/issues/44228
Change-Id: I4e8430749fcfbcbfc221c3733ee27ccbe6bcc1ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215941
Reviewed-by: Kaushik Iska <kaushikiska@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
We have a spike in exceptions internally, and I suspect that it was
caused by https://dart-review.googlesource.com/c/sdk/+/219942
But I was unable to understand why it happens.
So, this workaround is the best I can think of now.
Change-Id: I714eb6666706aad457b72e066978aa2d734fb89f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220640
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
* Add Canonicalize pass after CSE to erase graph differences between
64-bit and 32-bit platforms. These differences originate from different
treatment of integers (we unbox more eagerly on 64-bit platform) and
consequently affect load forwarding - which generates some redundant[1]
phis on 64-bit platform, but not on 32-bit platform. Adding this pass
also addresses other cases of unpredictable performance when IL changes
can cause CSE not to trigger a Canonicalize inside itself and regress
performance, by inhibiting subsequent optimizations.
* Allow IL tests to check whether the graph was compiled in sound
null safety mode or not - because graphs can have minor differences.
* Use `"$i"` instead of `i.toString()` in the test to allow TFA to
infer non-nullability of fields in non-sound-nullsafety mode.
[1] The definition of redundant phi differs between canonicalization
pass and load forwarding pass. The former unwraps redefinitions and
the latter does not. We are going to address this difference in a
more systematic way when we split input dependencies from control
dependencies.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try
Change-Id: Ifbd68fbb7f3b374ecee8ada1b3a4a2249139a108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220541
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
We should not need to retain functions which do not have any code,
the only reason to retain them would be for runtime to be able to
find the implicit closure (when performing lookup through API).
Additionally drop closure_functions array when producing
PRODUCT snapshot - because this array is not going to be used.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Change-Id: I29110ce613fdb347e2627d857f790e82602926d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219481
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
We don't use them anymore, the whole context collection is recreated.
Change-Id: Ie07d330a4928c3f85663a86d1dc83d8e3e28ab95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This minor change makes it a bit easier to consume ddc as a library.
Change-Id: Ie98a4fa78c313d827cf1a395b26a4f7859a9413c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220120
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
For some time now we decided to use canonical URIs for files in lib/.
Change-Id: I416ef87e7c4e6b27be9e1bc274deee67286a9d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220223
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Remove Dart_SetNativeServiceStreamCallback which is not in use by
any embedder.
TEST=cq
Change-Id: Ic6ecadb80d94b14cd2f89b5297d65c3ab7de75e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220131
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Redefinitions exist to prevent code motion and don't affect
the meaning of instructions they flow into as inputs.
Consequently, when comparing two instructions for equality
we should unwrap all the inputs.
The only exception from the rule is LoadField instruction:
we would like to avoid replacing a load from a redefinition
with a dominating load from the original definition because
that would break a dependency chain on the redefinition.
This change is done to address code size regressions caused
by retaining and/or inserting more redefinitions to prevent
illegal code motions. These new redefinitions impact CSE
optimizations and (without this CL) lead to redundant boxing
being left over in the optimized code.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: Idd917fcb8c7117670a1d9c5c32f1bae57569d3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219242
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
In Dart doing a type check against one value can constrain the type
of another value in an indirect fashion. This possibility needs to be
taken into account when inserting Redefinitions to inhibit the code
motion. This CL addresses two previously ignored situations:
* Given a generic container `C<T> c` which holds a value `T v` doing a
type check against `c` might narrow the type of `v`.
* Given two generic classes `C<T>` and `H<T>`, doing a type-check
against an instance of type `C<X> c` might narrow the type of an
unrelated instance of `H<X> v` within the same scope.
The second situation is currently limited to a situation when we do an
invocation on `this` and the target of the call has constrained generic
parameter (e.g. because the target of the call is in the subclass which
instantiates the base class with a more specific type
`class C_ extends C<int>`). Calls on `this` are special because
they are allowed to bypass argument type checks which are
usually performed due to covariance.
In both cases we need to ensure that all uses of `v` which are
using narrowed type are pinned to stay within the true successor
of the type-check against `c`.
Previously we would only insert redefinitions for the value that is
being type checked, but this is not enough and this CL tries to
address the newly discovered cases:
* When replacing loads in load optimizer we must ensure that
if replaced load was dependant on the redefinition (and thus
was pinned) the replacement is similarly pinned (if the type of the
load might have been narrowed). If neccessary we must insert a
redefinition for the loaded value itself.
* When performing inlining of calls on `this` we must insert
redefinitions for all parameters that might have their types
narrowed.
* When replacing phis which have redefinitions as all inputs.
Fixes https://github.com/flutter/flutter/issues/91370
Fixes https://github.com/dart-lang/sdk/issues/43652
TEST=vm/dart{,_2}/flutter_regress_91370_il_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I89c1f165615dd827102e9f6af90365af7d8f32b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219241
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
* Add support for dumping flow graphs in JSON (to make it machine
readable);
* Add support for controlling which functions are dumped through
a pragma annotation:
`@pragma('vm:testing:print-flow-graph'[, "passes filter"])`
* Replace simple matching DSL with programmatic matching
* Support obfuscated builds
Fixes https://github.com/dart-lang/sdk/issues/47340
TEST=vm/dart{,_2}/aot_prefer_equality_comparison_il_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: Ie067ba451d311e6019a8c3a88c012231b0c50eb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219240
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I8e2c41d480249b02f9645abda58469557091fc85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220281
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Returning the value is faster than reading the holder slot on V8.
Some benchmarks which read a lazy final in a tight loop are up to
40% faster.
JSC and SM unchanged.
Change-Id: I72afa456160469e4ccfe6ab80f8a53694133d794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220132
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>