At this time this only compiles to .dill and then compiles from multiple modular
dill files.
Next steps: add the global split and add the modular data bits
Change-Id: I3399776dbd5187ddb0a3e2fdd307622a736570c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102126
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Remove all `&& $strong` clauses.
* Delete all sections that include a `&& !$strong` clause.
Change-Id: Idd32cf5623793e3f98e3e998025bac079d88e2f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102223
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This allows to break a circular dependency between package:expect and
package:async_helper, which will simplify the support for modular tests using
package:modular_test.
Change-Id: Ie48723d3f35d51a8fbe622e0158450e8104fe3f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
+ avoid use of `compiler` and `backend`
+ make members of KernelSsaGraphBuilder private when possible
Change-Id: Ia069a8c3b4167c1ae55554baadb857975aeff67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101287
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- and preserve the original receiver type information during type propagation updates.
Change-Id: I20087b282a3d018947043d7a3ab7c45f003eaee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100966
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Most (all?) implementations now throw ArgumentError since the
StreamIterator constructor no longer accepts null but the actual
type is not specified.
https://dart-review.googlesource.com/c/sdk/+/98001.
Change-Id: I10a24a67aa7353552c56d435ef206a2bc4f842fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100987
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
As expressions and instantiations lose the connection to the current type environment when put into an unevaluated constant expression. This leaves type variables unsubstituted when the expressions are lazily evaluated leading to invalid compile-time errors. This is avoided by substituting the type variable when creating the unevaluated constant. If the type variables are not substituted by concrete types, this is flagged as a valid compile-time error during the lazy evaluation.
Change-Id: I46264da4332ea1d5b783531d89a5e6f85b8f90e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100963
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
We now track member usage in terms of static, dynamic and super access
for reads, writes and invocations. The information collected during
closed world computation is now the basis for the potential member usage
in codegen, thus ensuring that we cannot conclude in codegen that for
instance a field is read dynamically when the closed world knows that
it is never read dynamically.
Closes#36516
Change-Id: I3a1cb87c71268c34bcd67e14a035d9d1be324ab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100840
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Rationale:
Previous CL inadvertently removed the may-throw tag
from the AOT version of check bound. But, unlike its
speculative counterpart, this non-speculative check
will throw when out of bounds. Optimizations like LICM
rely on this property for correctness. Found with fuzzing!
https://github.com/dart-lang/sdk/issues/36803
Change-Id: I05952f423ffa1917a08dbb6191d0d1533450bc9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
After 347b72c260, this test began timing out on dartk-mac-debug-simdbc64.
Change-Id: I84fc6457c7e10068f761d25cbb1241e2c2f8ab49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
There were no checks for missing source or source position, which
caused flaky crashes while running test mirrors/mirrors_reader_test.
Change-Id: I73497414ebe7b030ba308851038e0ef9e133aa48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
For resolution this is the KClosedWorld and for codegen this is the new
CodegenWorld object. This change removes the use of the world builders
after the world building has ended. It prepares for computing more of the
result data from the collected member usages.
Change-Id: I80032e3fc0e29179137b8c0380f09f68ab6fa03b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commit 5ebb640a67.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
>
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
>
> This adds support for the following features:
>
> * Interpreting patterns as Unicode patterns instead of
> BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
> of '.' to also match line terminators
> * Escapes for character classes described by Unicode
> property groups (e.g., \p{Greek} to match all Greek
> characters, or \P{Greek} for all non-Greek characters).
>
> The following TC39 proposals describe some of the added features:
>
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
>
> These additional changes are included:
>
> * Extends named capture group names to include the full
> range of identifier characters supported by ECMAScript,
> not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
> objects, not Match objects, so that downcasting is
> not necessary to use named capture groups from Dart
>
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
>
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
For classes that implement Map, using MapFormatter can result in many,
many custom format operations. Also, the presentation is not that
useful. We get e.g. a list of indices that then have a name and value
beside them, so it just duplicates the Object view, but with extra
non-useful data.
Change-Id: I74ed34521778bddae9cdad975339925d7c181bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100282
Commit-Queue: Alan Knight <alanknight@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Rationale:
Under heavy register pressure, a Q register was
selected for which the corresponding D register
had no proper overlap with S registers, which
was required by integer division.
Test:
Real reproducer when use_integer_division=false.
Bug:
https://github.com/dart-lang/sdk/issues/36681https://github.com/dart-lang/sdk/issues/34472
Change-Id: I54162f4d6aee6ef9827907d9e97f2a476e9cbe4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100272
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Rationale:
The IA32 codegen has the concept of "safe smis", which
can actually be larger "mints" that can be constructed
in a safe way (e.g. shifting). However, at a few places,
this caused confusion, since following code assumed
that such values can be casted to "smis" always.
This CL fixes that. Found with DartFuzz.
https://github.com/dart-lang/sdk/issues/36589
Change-Id: I6bf308897abfb0aad965c7fbaf8f374a1ba30d41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100089
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
The `new array.constructor()` pattern is occasionally used in JS
(presumably, to get the array subtype if one is available). GopherJS in
particular does this. This fixes DDC's generic `JSArray<T>` to support
this pattern, for all values of T. This also makes JSArray work like
all other "native" types in DDC, where the "constructor" property
is the JS constructor for that native type.
Change-Id: I5270bd648d3d60cf07b8548fcd8c9b9d1a3018d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99940
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Code collection interacts badly with
- warming up compiled code
- retaining pre-compiled code
- code coverage
- hot reload (deopting to an old version of a function)
Change-Id: Id269a6c3281e577d4f600f0c158af9e62f6b49ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Returning since they should be valid with the `constant-update-2018` experiment
flag:
* control_flow_collections/if_const_test.dart
* control_flow_collections/if_const_error_test.dart
* spread_collections/const_test.dart
* spread_collections/const_error_test.dart
Should be deleted when UI-as-Code is supported in constant collections:
* control_flow_collections/if_const_syntax_error_test.dart
* spread_collections/const_syntax_error_test.dart
Change-Id: I595333782630122ae4f3d021841b062b27e1cccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
* Update tests to expect compilation errors when `if` `for` or `...` are used in
const collections.
* Remove constant-update-2018 flag from tests.
Change-Id: I477c30f07c7e3da6139f263e1855c3908c1bce2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
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>
Non-primitive constants were incorrectly stringified in an unevaluated
context. These are now, as with unevaluated constants, checked when the
string concatenation is fully evaluated.
Closes#36609
Change-Id: Ia3266ebcb9d497b277690244569812f7cd3e30c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99461
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
These tests validate simple uses of trailing `?` syntax, and exercise
the ambiguous cases mentioned in the draft spec.
Change-Id: If2526c7f4c898495d667d7e16a2005bd8432f8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99183
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
(now that it has a fileOffset)
Change-Id: I057ca3cf04a941ccdb03a6d8ca58947650b1cbec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds support to DDC's Kernel backend for instance constants
inlined across module boundaries, by saving private name symbols
so they can be referred to from outside of the current module.
Change-Id: I28d45d1844f5351f506cc7606dd1c4803037304e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98926
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
If we're targeting a JS backend, `isSubtype` considers every int to be a
double. We need to additionally allow any integer-valued double to be an
int. This mainly allows us to handle signed zeroes correctly.
Fixes https://github.com/dart-lang/sdk/issues/36562.
Change-Id: I00d1e693bb3f1268ac100a76c9bec8fcc612b182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99101
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Fixes https://github.com/dart-lang/sdk/issues/34147.
The Dart language specification says we should ensure booleans are
non-null in the following (non-exhaustive) situations:
* (ternary) conditional expressions - this includes the `!` operator
since `!x` is equivalent to `x ? false : true`
* arguments to logical boolean expressions (`||` and `&&`), modulo
short-circuiting
* `if` conditions
* `for` loop conditions
* `while` conditions
* `do`/`while` conditions
With control-flow-collections enabled, this CL will also cover
conditions in `if` elements and `for` elements. Tests for these already
exist in
language_2/control_flow_collections/{if,for}_null_condition_test.dart.
Change-Id: I2ce9a30adeb16a0a68411f358f69aeca08656dab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98780
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The .getStaticType results for NullLiteral and NullConstant are inconsistent. The former returns `const BottomType()` and the latter return `TypeEnvironment.nullType`.
To avoid this inconsistency and since `const BottomType()` is really the "unreachable" type, used for instance of for the type of a throw expression, the implementation is changed to consistently use the .nullType.
For this to work, getStaticTypeAsInstanceOf (and the equivalent dart2js implementation), and the `Type.fromStaticType` constructor in the VM type flow analysis have to special case the .nullType.
Change-Id: If6b806d4a39ef7b906275c43fa2089b9d140523b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98563
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This brings Analyzer's type inference in line with the language spec.
Similar to CFE, the inference function now takes an isConst parameter,
which if set, tells it to eliminate type variables from the context
type.
Change-Id: Ied67bac39d73c9ecd7e0a482a0c8db77272637cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98707
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Bytecode configurations should have the same test coverage as default mode.
The following tests are excluded in dartkb mode as there are too many crashes:
- service/* (debugging capabilities are not supported);
- lib_2/mirrors/* (mirrors are not supported);
- vm/cc/* (bytecode modes are not wired up in run_vm_tests).
Change-Id: I11eead94b96f43ab454acd6e6f6861af943c0488
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97847
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
When tests are executed on certain configurations like dartkb or simarm,
the test script is first compiled into a dill file, so the VM command
line for running a test looks like
dart .../generated_compilations/dartkb/foo_test/out.dill
Certain tests have the logic to replace '_test.dart' in Platform.script
with '_test_body.dart' and execute the resulting script.
However, as out.dill does not contain '_test.dart', the script remains
the same after replacement. As a result, test was infinitely re-executing
itself, overloading bots and not making any progress.
Change-Id: I7257d3553a7f0a0de2f6d8218a9eb5c8981af17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98685
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Thread assert enable flag through in dart2js to make the dart2js cfe
constant evaluation unit test properly pass the flag.
Fixes https://github.com/dart-lang/sdk/issues/36454
Change-Id: Ie4ac86ce96feda1548120fed54ece9ca03387496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98570
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This helps triage/resolve various issues in testRuntimeErrors:
* for_non_bool_condition_test isolates the code causing a crash on the
dart2js-production-linux-d8 configuration. (See
https://github.com/dart-lang/sdk/issues/36442 and the status file.)
* for_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/36446.
* for_runtime_error_test contains all the remaining expected type
errors. On the dart2js-production-linux-d8 configuration (which runs
with -O3), we assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.
* for_test contains the remaining tests, which are valid on all dart2js
configurations.
Change-Id: Ifef4f7d2e27e2731cdd4a3fec03754ea63b6328d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98606
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This helps triage/resolve issues in testRuntimeErrors:
* if_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/34147.
* if_runtime_error_test contains all the expected type errors. On the
dart2js-production-linux-d8 configuration (which runs with -O3), we
assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.
Change-Id: Iaf2df85af16cc03fcd7ec7ef2a9e57a2bc3ce081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98622
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Including supertypes (and not just superclasses) this time.
Change-Id: Ib398f6f2fab0ae502dd754727b482641793dd225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98569
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
These tests break on all backends. It looks like the original intent was to run to completion.
Change-Id: I895638c522285f280cbb608c82a8a496bfd11d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98302
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The change was already reverted and I accidentally relanded this.
Change-Id: I62ff3367db7aaaf3a470727fdb587830a23fe53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98566
Reviewed-by: Martin Kustermann <kustermann@google.com>
This is a reland of 49c94d3600
It appears that the major regressions were introduced not by the typed data unification
changes but rather by 3fd124db1f "[vm] Repair the resolver abstraction." which got
reverted in e979895efb "Revert "[vm] Repair the resolver abstraction."
Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
>
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
>
> This reverts commit a062221b76.
>
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
>
> This reverts commit 94362f1af0.
>
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
Change-Id: I758775ccc426a02bce538d07ea04d9c67e8933d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98562
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
When disambiguating between maps and sets, ensure that `await for`
loops are marked as asynchronous. Otherwise, there will be a spurious
type error because we have a Stream and would expect an Iterable.
Change-Id: Ie97eaf74ff7a9e4dfb262ab0447f4322d04701aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98467
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This reverts commit 49c94d3600.
Reason for revert: Relanding
Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
>
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
>
> This reverts commit a062221b76.
>
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
>
> This reverts commit 94362f1af0.
>
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
TBR=bkonyi@google.com,asiva@google.com
Change-Id: I5c5be67fcec05434283153cb2592ba41afd1f41f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98505
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
This reverts commit a062221b76.
Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
This reverts commit 94362f1af0.
Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Types are compared with `Expect.equals` instead of `Expect.identical`
since they are not always canonicalized.
Change-Id: I43c878986d190c361efaae321621f204a4bb8495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98425
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Invocation of == and != is only constant on receivers of types bool, int, double, and String or null operands. This is now handled correctly in constant evaluation. The case for method invocation of `a != b` is removed since it is parsed as `!(a == b)`.
Change-Id: I65d8ddf2716f319f61fc0609803a5237f4aba644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98349
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Added tests and changes to constant implementation have changed
the result of the front-end compiler on some tests.
Change-Id: I112027f2ca5ed72cc640ce01f577e498020866f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98356
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The constant evaluator assumed that any ConstantExpression met during evaluation of a sub expression was not an unevaluated constant. This do occur, for instance when a field is initialized to an unevaluated constant. With the change, unevaluated constants met during evaluation are themselves evaluated.
This change also fixed handling of assert initializers in unevaluated constants.
Change-Id: Id9e676f40bc829c4d234f34a74ef0ca5c4c6ec48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98348
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Tests that dart2js can handle evaluation of unevaluated constants from CFE, including handling of potential compile-time errors found during evaluation.
The CL fixes a bug in the constant evaluator where it created map literals that were not marked as constant as needed.
Change-Id: I7df77a3c68e52392a143478b3567d19e09ebe6bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98347
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: I5f06c2849ed3f610023a399f65c0cbfaf1921b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97510
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This moves the length field as well as an inner pointer to the start of
the data into the RawTypedDataBase class. The inner pointer is updated
on allocation, scavenges and old space compactions.
To avoid writing more assembly the typed data view factory constructors
will be generated using IL, which will update the inner pointer. This
required adding new IR instructions and changing the existing
UnboxedIntConverter instruction.
This is the foundation work to de-virtualize calls on the public typed
data types, e.g. Uint8List.
Issue https://github.com/dart-lang/sdk/issues/35154
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try
Change-Id: I1aab0dd93fa0f06a05299ab4cb019cf898b9e1ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This fixes a problem where a set or map in a spread would not be
properly recognized by the constant evaluator when compiling for a
VM target.
Fixes https://github.com/dart-lang/sdk/issues/36387
Change-Id: I01efc932994c143fa5a5a2fbacda21fe9206e3e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98330
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Rolls the version of co19 tests in the SDK checkout to
c3b33ee90c5ee7f88fdb0ead08fdbb40c54954d2
Change-Id: I11a181e2fb1e37ff73fb038cd51b3ad38e2a0ae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98344
Reviewed-by: Jonas Termansen <sortie@google.com>
Change-Id: I9ba3aa4e3ebaedee3a2cd20ccdcc533af96b9bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98018
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Those will be failing in 2.3, and we don't want that to make the entire
await_for_test to fail.
Change-Id: I5f81ada877a5ecef8a3034f071313a6729b53aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98242
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
dart2js doesn't canonicalize types so comparing with identical causes the test
to fail.
Change-Id: I3e6f19f8ab95d949402c3bf0caf0c31cc0fccbad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98241
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This lets you test that a callback returns a Future that completes to
a given error. Like Expect.throws(), but async.
At first, I added support for this directly to Expect.throws(), but I
think it's better to minimize the amount of dynamic logic going on in
the language test framework.
I was worried about having to duplicate all of the Expect.throws___()
convenience functions but now that we have generic methods, those
functions aren't that much more convenient.
Change-Id: I8b288945611fa16f8d27056f3cf79181fc22d256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97881
Reviewed-by: William Hesse <whesse@google.com>
It's not a compile error. Instead, a runtime cast is inserted.
Change-Id: I871191d9f6fdb72276449abe7016c86ac098fd60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97946
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Since we already have support for Block in our visitors, we can extend
them to support BlockExpression fairly easily.
co19_2 and language_2 tests still need to be unskipped, but we can't do
that until CFE respects the --enable-experiment=control-flow-collections
flag.
Change-Id: I48da19cc33dbf35c5ead3ea13266b01d3e0de959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97820
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.
Size of dilp files is reduced by 11-12%.
Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms
There are following regressions in bytecode mode, which will be fixed
in future:
* dart:mirrors are not supported yet (implementation of mirrors relies
on reading kernel AST in certain cases).
As the result, lib_2/mirrors/* tests fail.
* native extensions are not supported yet (annotations on libraries
and classes in AST are cleaned up as they could reference members
which are now removed from AST).
As the result, standalone_2/entrypoints_verification_test test fails.
* language_2/spread_collections/const_error_test/* tests fail
due to https://github.com/dart-lang/sdk/issues/36286.
Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Add support for compiling for and for-in loops in map literals. They
are lowered to block expressions.
Change-Id: I555401257ba028543310edbd0547166d7c6a26a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97929
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Implement the translation of for and for-in loops in non-const lists
and sets. They are lowered to block expressions containing a loop.
It is impossible to target these loops with a break or continue
because they do not contain statements in their body.
Type inference is not yet implemented.
Change-Id: I35ff1650fde54cd376fe0b444891010435c74507
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97922
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
New tests were added without status file updates.
Change-Id: Ibd8e48d6a3818e69649e881594be78afd490ba91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97920
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
In collection literals, support for and for-in in Fasta's body
builder. They are removed when encountered during type inference and
their lowering to block expressions is not yet implemented.
Change-Id: I41e6a7a4aca7ffafdc12119e1503e9c0df5a6589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97628
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This doesn't cover all of the corner cases around the synthesized
stream subscription and stuff, but I honestly don't know if I'm
qualified to write those tests. This should cover all of the basic
static and runtime semantics that users care about.
Change-Id: I7237f0ccb9bf02af291d3175ab2c0074d0547c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97548
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This reverts commit 9db4119b67.
Revert "Change default of 'keepFields' in constant transformation to true"
This reverts commit b1e14cbe5f.
Revert "[fasta] Don't create forwarding stub if there's already a member"
This reverts commit 51da94da76.
These commits are reverted to unblock rolls into Flutter.
b1e14cbe5f is reverted because it contained
changes that prevented clean revert of the other CLs.
Change-Id: I8d3c00f0c1b146f4debe7f1a1a7de75be154e265
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97802
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
* Move FFI tests into a separate test suite.
They never belonged in standalone_2/ since they are not only available in
the standalone VM. Also, we want to have a separate status file.
* Add new "SharedObjects" option to test files to copy needed shared objects
to the Android device for testing.
* Add support to compiler/runtime_configuration.dart for testing JIT-mode on Android.
* Add new configurations and builders to test_matrix.json to test JIT-mode on Android.
* Clean up status file entries for FFI (we didn't need to special-case stress & subtype tests).
Change-Id: Ifb32ef7051754f477d00ecd7a0f9b19ca8a66eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97334
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This is necessary to support modular constant transformation as
needed for instance of for platform dill files.
This change also restricts the removal of additionExports to fields.
Change-Id: Ie7379f09672d8caeaf0689d42af9e1246b9678fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97632
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Also clean out obsolete status file entries due to renamed constant
update test directory.
Change-Id: I135d8c9cac19342143bf8154d1b2e72cf0b8dd01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/93161
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Given `obj.foo(1, 2, 3)`, if `obj.foo` succeeds but `call()` on the
resulting object fails, DDC should call `noSuchMethod()` on the result
of `obj.foo`, not on `obj`. This CL also adds a few more test cases that
DDC was failing on.
Change-Id: I76c3cc73e4cc81791f961c6b2a55cbfea7a5240b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97701
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
1. Remove support for the following flags '-c', '--checked' and '--enable-checked-mode'
2. Cleanup some of the tests and test scripts where these options were being passed.
https://github.com/dart-lang/sdk/issues/34660
Change-Id: I4d8aa0d14bd054cfba08d78a411a0df4fc829df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97550
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Change-Id: I2760f72f4eaa44bd192747179e843f017db30874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97301
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
- Use "{" and "}" for maps.
- Add tests for Object and non-Iterable in for-in loop.
- Fix copy/paste error in inference test.
Change-Id: I563df4e94e221a1a03bbc52cf6f312aae5e07310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97524
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Add regression test.
This fixes issue 36084.
Issue 36293 filed against ddc, which fails on the new test.
Change-Id: I1112572d72671fbc1d78a768ee85affff41951a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97142
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The test corelib_2/regexp/lookbehind_test/01 always passes or fails
uniformly on a single build. But on different builds, on dartdevk on
mac.
TBR: vsm@google.com
Bug: dartbug.com/36280
Change-Id: If70b7a2f0ce34e9f8ba3032d17e7244f2e84aa96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97332
Reviewed-by: William Hesse <whesse@google.com>
Change-Id: I1704001605f01721b01254fdc032aacebf472c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97304
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
If elements are compiled to if statements. The type inference rules
including insertion of runtime checks are not yet implemented.
Change-Id: Iaa7ab709a7acacf952887b17ac1081a9fecd7cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97200
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Due to API changes, the implicit cast visitor (CodeChecker) was not
finding the correct substituted member type, so the implicit return
type cast was not inserted.
Also fixes another issue that paulberry@ discovered: covariant return
type casts were overwriting the implicit casts from the context type.
The context type should always take priority; implicit covariance
checks are only needed when there isn't a type cast from the context.
Change-Id: I998e8f87371c15175c57864b7e334449268fe339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97143
Reviewed-by: Paul Berry <paulberry@google.com>
See https://github.com/tc39/proposal-regexp-named-groups
for a high-level description of the feature and examples. This is one of the
features requested in https://github.com/dart-lang/sdk/issues/34935.
This is a partial implementation because while there is a way to retrieve
groups via Dart by name, it requires casting the returned Match to the
new RegExpMatch interface to avoid changing the RegExp interface.
Changing the RegExp interface will happen in a future update, since there
are other planned changes to the RegExp interface coming soon and that way
we only change it once. See https://github.com/dart-lang/sdk/issues/36171
for more details on the planned changes.
Also, since only BMP regular expressions are supported, not full
Unicode ones (i.e., those with the /u flag in ECMAscript), \k<NAME>
will only be parsed as a named back reference if there are named
captures in the string. Otherwise, the \k will be parsed as the identity
escape for backwards compatibility. The new tests illustrate this
difference.
Change-Id: Ieeb0374813db78924c9aa8ac3e652dfb6d4a5934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95461
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
When testing runs with certain set of VM options and tests launch
new Dart processes, VM options should be also forwarded to child
processes.
Change-Id: I7207fe87672cd61fd50d7ac77ef1da67744af183
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97169
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>