Rationale: Forces the fuzzer to generate a string literal
as the parameter of selected string functions (i.e. padLeft/Right)
in order to avoid recursion of the form x = "".padLeft/Right(x).
https://github.com/dart-lang/sdk/issues/37573
Change-Id: Icd9f5da07ccdd44e81c88a450c3d2cdd7c8e8f95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109893
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Type expression GVN needs to structural equality on TypeRecipe and
TypeEnvironmentStructure.
Change-Id: Iaa4985ec99fff6db29e8bfd63fd0dbacdc10dde6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109942
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Even if a scope doesn't have variables, it may define a context
level different from enclosing scope. As debugger needs to know
context level at any point, bytecode generator should not elide
such scopes.
Change-Id: I2f97deae55285b758f91aee852338432dcddf373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109898
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
By reusing ConstantEvaluator instance among members we avoid
recalculating values of constant static fields.
Change-Id: I5c13489a353bf101cd4a01d5993e44842042c2d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109892
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Rationale:
Floating-point operations have some potential for
false divergences (mostly when going through libc
methods that are compiled differently between 32-
and 64-bit. To avoid these, a --no-fp flag has
been added to dartfuzz.dart which can be used
to dartfuzz_test.dart to avoid floating-point
operations when comparing 32-/64-bit execution
modes.
https://github.com/dart-lang/sdk/issues/37335
Change-Id: Ie3c28f2a6e2d257b8e9adbba79d088b3879264ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109891
Reviewed-by: Felicitas Hetzelt <felih@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This uncovered two more instances where we weren't properly
registering variables:
- Local function parameters
- Variables introduced by "catch" syntax.
- Variables introduced by "for (...; ...; ...)" syntax.
Change-Id: Id5e8aa1b598962cca1bb19df6d4ede99a672f108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109885
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reverts commit dbeceb1d06.
Reason for revert: Exposes private VM service methods
Original change's description:
> [ VM / Service ] Pulled in vm_service_drivers from its own repo.
>
> - Updated various paths to point to the sdk repo instead of the
> vm_service_drivers repo.
> - Updated generate.dart to use the service.md from the SDK, not a copy.
> - Removed hidden files that are no longer needed.
>
> Change-Id: I11b1f2e32d55f1fdaaa6eb9ce34fc318716c36f9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109120
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
TBR=devoncarew@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I44af2074ba13dec41ffac3c25330e4603c50b06a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109895
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Change-Id: I2762d60dc739adc046d7c438ae8eadae550bfa97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109941
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This updates the exception message to capture more information
about where the exception is occurring. Hopefully that information
can be used to fix https://github.com/dart-lang/sdk/issues/37528
Change-Id: Iaf10395091f8bd8b540dddc59001f23b6dc6a073
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This renames the "exclude" option to make it more clear exactly
what is being excluded, similar to the earlier change renaming
"include" to "fix".
Change-Id: I07d164d480c8e389e5c7353db81e7633f0efd3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109921
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
- Updated various paths to point to the sdk repo instead of the
vm_service_drivers repo.
- Updated generate.dart to use the service.md from the SDK, not a copy.
- Removed hidden files that are no longer needed.
Change-Id: I11b1f2e32d55f1fdaaa6eb9ce34fc318716c36f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109120
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This is a first pass at breaking up runtime_types.dart.
runtime_types_resolution.dart contains the former parts of runtime_types
that runtime_types_new depends on (namely, RuntimeTypesNeed and
RuntimeTypesSubstitutions), as well as their transitive dependencies.
This leaves just the code responsible for encoding the old type
representation in runtime_types, mirroring what we have in
runtime_types_new. As a result, both runtime_types and runtime_types_new
have runtime_types_resolution as a common dependency, but
runtime_types_resolution does not depend on a particular encoding.
However, runtime_types_resolution is still over 2.5 KLOC and still
depends on the old TypeCheck representation.
Change-Id: I22d932d2695cb573c2a3b4dafe5132d4e424fa77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109557
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Rationale:
A divergence can be caused by differences in test
output, timeout or crash. This patch displays the
return code of the test program, so that the latter
two cases can be distinguished.
Change-Id: Id5520a2da41aad191c0878148acfff2c98c110aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109682
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Originally, Timer for timeout is created after controller.add() where onCancel has been triggered. Timeout events will always be called.
Bug: https://github.com/dart-lang/sdk/issues/37565
Change-Id: I1504694cb746b6653d858effd7c5b33b07de6057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109725
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
+ Make more internal properties private
+ Add documentation on more properties/methods
Change-Id: I40779c83fcb7f888e485ccbc7b1fad312199806c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109710
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
We no longer need the distinction between *Generator and Kernel*Generator
so the Kernel*Generator classes are now merge into the *Generator classes.
Change-Id: I9f9650fc4ab88a0952b8d2bd346e1d416d68eac6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109707
Reviewed-by: Dan Rubel <danrubel@google.com>
To share support for annotated tests based on Features.
Change-Id: Ic319442e2e016bf4d1584825ea019d13a74acedb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109560
Reviewed-by: Stephen Adams <sra@google.com>
The flow analysis engine is now responsible for figuring out whether a
promotion actually occurred; this is less error prone.
Change-Id: Idce8af01fae982a9cc240ec4675812f8d7fd68a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109883
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I think this makes the message better, but it also means that the message
can be internationalized.
Change-Id: I0697fc05b79e33d5af2424609b30c2832b1a210b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
I ignored unnamed extensions for now, so correspondings tests crash.
R=brianwilkerson@google.com
Change-Id: I3e56d1ccaf0c5839b426ea179ed6100dbb15c143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109727
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Includes an integration test illustrating where this would have caused
incorrect behavior (due to the fact that the analyzer's `DartType.==`
doesn't yet distinguish nullabilities - see #37587), as well as unit
tests that will ensure we don't regress even after #37587 is fixed.
Change-Id: Ief92cf5a052bc2b96e4e74f69f2268b0565d920f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
We now track nullability via type promotion, e.g. by promoting from
`int?` to `int` to represent a non-nullable value.
I've added a few more unit tests of flow analysis that were helpful
while preparing this CL. I plan to add more tests in follow-up CLs.
A few behaviors are lost by this change:
- We no longer track whether a variable's value is exactly null
(previously the tests annotated such variables as "nullable", which
was a bit misleading). I'm not sure whether we really want this
feature or not; I've filed
https://github.com/dart-lang/language/issues/461 for discussion.
- Assignment of a non-null value to a nullable-typed variable no
longer promotes it to non-nullable. I think we want to get this
behavior back, but we'll need to add a little bit more machinery to
get it back (we need to allow assignments in general to promote.
I'll address in follow-up CLs. See
https://github.com/dart-lang/language/issues/440 for discussion.
- A promotion to non-nullable that happens during a "try" block is
lost if there is a "finally" block. I think we want to get this
behavior back, but we'll need to add a little bit more machinery to
do so, to allow promotions in general to be preserved by
try/finally. I'll address in follow-up CLs.
Change-Id: Ibc45d70043725697fbee063a8dcefb1179506e9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109780
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I will add further unit tests of flow analysis in follow-up CLs.
Note that flow_analysis_unit_test.dart does not make use of the
test_reflective_loader package because the intent is to move these
tests into the front end, and front end tests are written using
vanilla package:test conventions.
Change-Id: I10ba27212a1986f0c1fd960d33105f281712b506
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The new flow analysis will only function for libraries that are opted
into NNBD, therefore if we want to test that a variable is properly
promoted from a nullable type to a non-nullable one, we need its
declared type to be explicitly marked as nullable.
Change-Id: Ia649167f8069c37b3907ba63cabf4f50224dbade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109745
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reduces the risk of mistakes and avoids downcasts.
Change-Id: I98f021e0dd6754ee499a08aabe4fee00d17501ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109744
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>