This has been dead code since the bytecode interpreter has been removed.
TEST=This removes dead code. Building the SDK tests this code is not
imported. Running the CQ tests it was not executed.
Change-Id: I75ce3fc2dfccb57d3287db7e716901a8b5a0c20e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211264
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
`int` variables can attain NaN values because web int arithmetic
implemented by JavaScript numbers (doubles) is not closed under many
operations. It is possible get NaN using only addition:
int a = 1, b = -1;
while (a + a != a) { a += a; b += b; }
int nan = a + b;
On the VM, a, b and nan are all zero.
On the web, a, b and nan are Infinity, -Infinity and NaN, respectively.
Since NaN can leak into int arithmetic, is it helpful if bounds checks
catch NaN indexes. NaN compares false in any comparison, so a test
of the form
if (index < 0 || index >= a.length) throw ioore(a, index);
fails to detect a NaN value of `index`.
This is fixed by negating the comparisons, and applying De Morgan's law:
if (!(index >= 0 && index < a.length)) throw ioore(a, index);
These changes have been applied to JSArray.[], JSArray.[]= and String.[]
For dart2js the change is a little more involved. Primitive indexing is
lowered to code with a HBoundsCheck check instruction. The code generated
for the instruction now uses, e.g. `!(i>=0)` instead of `i<0`.
This leads to a small code size regression.
There is no regression at -O4 since bounds checks are omitted at -O4.
At -O3 (where the regression is largest) the regression is
0.01% for cm
0.06% for flutter gallery -- array-heavy diff and layout
0.21% for Meteor -- array-heavy code
0.30% for Box2DOctane -- array-heavy code
I believe the regression can be largely alleviated by determining if
NaN is impossible at the index check, and if so, reverting to the smaller
code pattern. The analysis could be global, incorporating NaN into the
global abstract value domain, or a much simpler a local dataflow
analysis. Many indexes are loop driven and cannot reach infinity because
they are incremented by a small bump and eventually (even without a loop
guard) the index would stop growing when the increment falls below the
rounding error in O(2^53) iterations.
Change-Id: I23ab1eb779f1d0c9c6655e13d69f65d453db9284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210321
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
This change replaces graph intrinsics and call specializer code for
certain _Double methods with a body created in FlowGraphBuilder.
double.floorToDouble micro-benchmark on AOT/x64:
Before BenchFloorToDouble(RunTime): 642.3240205523442 us.
After: BenchFloorToDouble(RunTime): 268.0320289466631 us.
double.floor micro-benchmark on AOT/x64:
Before BenchFloor(RunTime): 760.7630277672118 us.
After: BenchFloor(RunTime): 537.2132688691916 us.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46650
Change-Id: I47f5d8a1bdc0f71965ad1763c7bc46540428c6cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210652
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
In the unoptimized code unboxed double inputs are now unboxed in the
instruction prologue, and unboxed double output is boxed in the
instruction epilogue. Double values are still always boxed on the
expression stack in the unoptimized mode.
Support for unboxed doubles in unoptimized code allows us to have
one implementation of double and dart:math built-in functions,
shared across optimized and unoptimized modes.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46650
Change-Id: Ic1e42b72ee80cb2c12019b7abab8111240b05efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211302
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Follow-up to c8b0f9c915
Change-Id: Ie2ef22705a20f2a694e5f797d542acff70fee6cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211466
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Every known user of the coverage report just wants the line numbers. At
the moment they have to do a second RPC to get the Script object, so
they can translate the token positions into line numbers.
Slower test times with coverage are usually caused by the extra time it
takes to run the RPCs. So reporting the line number directly will halve
the time it takes to get coverage, for most users.
Bug: https://github.com/flutter/flutter/issues/86722
Change-Id: I7b8d436669713ebc7b7096790a02593b9cb94dda
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211081
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Change-Id: I3ea0be4032c3f9999239f2ae58514d21df9045d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211281
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
boringssl seems to be confused when expired certificates are present in trusted root, only picks up the first matching one which could be expired and ignores still-valid-ones.
TEST=secure_socket_utils_test
Fixes https://github.com/dart-lang/sdk/issues/46370
Change-Id: I5bbc0a1a3331ce4dcda46eee41b02b5b6e835b2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211160
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
TEST=This CL skips a test that times out and OOM.
Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try
Change-Id: I99bd5e00e1dae672a252e932cd5501b2ac933019
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211401
Reviewed-by: William Hesse <whesse@google.com>
This is attempt to workaround a possible CPU bug on Exynos 2100 SoC.
The fix is tentative as we were unable to locate an erratum which
matches the symptoms and the specific code pattern.
https://github.com/flutter/flutter/issues/88261
TEST=user manually verified the fix on a Exynos 2100 SoC device
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-ffi-android-release-arm64-try
Change-Id: I3be20d47d710a6bc520f2f7d6da81483baf74787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211240
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Unless I'm missing something, the map that is being referenced here is `x` from the function argument. It looks like calling it `map` was just a typo. Alternatively rename `x` to `map`.
Closes https://github.com/dart-lang/sdk/pull/47000https://github.com/dart-lang/sdk/pull/47000
GitOrigin-RevId: 940442bfaa1517b33f811488773618e6f2e387d8
Change-Id: I0d24e28edef7f6e941d3247f7d647b22670a35b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Change-Id: I750345600d3b47de44c060511be35aea8744eca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211140
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
https://github.com/dart-lang/language/issues/1785 has a wide enough
impact that its fix will have to be bundled in with a language version
(i.e. future versions of Dart will have to reproduce the old buggy
behavior for code that's not opted in to the latest language version).
Therefore, we'll have to maintain tests of the behavior both before
and after the fix. This CL is the first step in that process, adding
tests that validate the current (buggy) behavior.
Bug: https://github.com/dart-lang/language/issues/1785
Change-Id: I78f17999ac1cbc096a312ef977db24654e06a263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
When checking if the guarded receiver CID has changed, we must find the original guarded CID by looking in the original ICData entries array. The first entry in the current ICData entries array might not correspond to the original entry because we sometimes re-order entries. For example, insert the Smi case at the beginning.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/46948
Bug: https://github.com/dart-lang/sdk/issues/46980
Change-Id: Id0904de3a68fbb77842f552329a14c3127ee9fc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211082
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This flag prepares for the removal of the special case of implicit
creation syntax, `foo<bar>.baz()`, which with constructor-tearoffs
doesn't have to be a creation expression. Since both the analyzer
and the CFE needs to support parsering without special casing
before it can be removed, the flag is added to ensure both
implementations will agree on what the future parser behavior will be.
The CL hard-wires the CFE use of the parser to a single constant value.
Change-Id: I04724f039d2e698f3cf67e8b0b56dfa7e96ed3b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Tool will try to extract useful information from invalid (e.g. partial
or wrong version) dill.
This is a first stab and could possibly be extended and improved in the
future.
Change-Id: Ib381794a3fe80036bb845800488fa0e1a7f04f83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211241
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Formatted with `--fix`, followed by some small manual changes:
- Reflowed some comments to 80 columns.
- Replaced Map/Set constructor calls with {} literals.
- Removed type argument when on both sides of initialization.
Change-Id: I3f5d29dd7e144f96a02efa95db8b40bf63484442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210940
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>