Rationale:
Two safe non-speculative cases were missing,
causing AOT to crash on some fuzzing sessions.
Note fuzzer is regression test here.
https://github.com/dart-lang/sdk/issues/38145
Change-Id: I12c633d66e387c703f1bcf0b6eebd50165bb2970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115445
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
When running from a dill file with AST on the VM with bytecode, we should
ensure that bytecode class declarations are loaded when class is referenced
from a type in AST. Otherwise we could attempt to finalize a type without
proper class declaration.
This change fixes pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test
with bytecode.
Change-Id: I7a9975e1af6b9e04575f41c5e78b1c2154106e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115460
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Rationale:
Control flow collections are already the default for
a while, but this TODO was still there. We are now
testing all features of CFC fully. Also did some
comment cleanup and removed old-style "new" syntax.
Moved constructors into try-catch just in case
we will add code into constructors in the future.
Change-Id: I557650575f41d7501a0c6f37c07756ca47ad54fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115444
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Two changes:
- Rather than remember to call `FlowAnalysis.finish` at the end of
each test, we now have a `_Harness.run` method that calls it
automatically.
- Variables are created using `_Harness.addVar` and their declarations
are reported to flow analysis using `_Harness.declare`. This allows
us to more easily test scenarios where a variable might be
referenced before its declaration site is encountered (which might
occur due to analyzer error recovery).
Change-Id: I0eff619840aeb057dcce8d64b6c6d23a265f81bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Fixes ~22 exceptions with a stacktrace containing the line:
DecoratedClassHierarchy.getDecoratedSupertype (package:nnbd_migration/src/decorated_class_hierarchy.dart:59:10)
Change-Id: I59bfcf19044f2bd985ec9bd4b33f307f9ab5bb24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The first bug was that we were assigning an empty map to
`_genericSupertypeDecorations[class_]` prior to computing the supertype
decorations, and then updating the map in place. This meant that if
an exception occurred while computing the supertype decorations, then
any subsequent requests for supertype decorations on the same class
would lead a partial result. This led to a lot of weird
counterintuitive behavior.
The second bug was that `Variables.decoratedDirectSupertypes` wasn't
updating the `_decoratedDirectSupertypes` object when an entry wasn't
found; as a result, we were doing a lot of redundant computation.
This should address ~184 exceptions whose stack trace includes the line:
DecoratedClassHierarchy.getDecoratedSupertype (package:nnbd_migration/src/decorated_class_hierarchy.dart:59:10)
Change-Id: I7b7e5191f77c0e1d299923a99d841b6c11ca28c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115075
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
There was only one call site, and the logic is clearer if all the
logic is in one method.
Change-Id: I59a6e0ce1e3345039146525a9bcd0b72025cbb5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115006
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Deleted comments are collected and printed or written to a spearate file (when using -w).
Adds an option -i to resolve the status of issue using a log file of issue status changes.
Change-Id: I3939ef949cb32738755065ec74af238d12f71e55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114847
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Fixes also some implicit to bool conversions in native_api_impl.cc
Change-Id: I31aecaa1e442f7f934de46ee019765f9f0746658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115248
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change-Id: I8e5d565cf92491c486d1210455837adeb317c6b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114856
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
That should allow us to "implement"
6f85cb83cf again in two steps:
* first we remove the dart:profiler as a required library, but retain it in the platform
* (we wait for stuff to roll, both in flutter and in google3)
* we remove it completely (i.e. not retaining it in the platform, removing the source etc)
Change-Id: Ieb77c2ba909300c05f3923c2edba7cab7d34fae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115244
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Update optionalTypeArgs to consider mixins and static extensions
* Update visibleForOverriding to consider mixins
* Update visibleForTesting to consider private declarations, and
declarations on unnamed mixins
Bug: https://github.com/dart-lang/sdk/issues/38105
Change-Id: I50b87e0fafd7960abc945b240788b1a640f78621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115067
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Rationale:
Both the interpreter and compiler had some logic on when fields
could be unboxed. Rather than duplicating this logic, this CL
uses the same methods to get a more consistent view of unboxing.
Note that this add a slight overhead to the interpreter, but
only a slight. We could avoid this by duplicating the logic
to enforce consistency, but this has the danger of getting
similar issues in the future.
https://github.com/dart-lang/sdk/issues/37821
Change-Id: Icf0c1ad518d75c63e9da72e1f75eaf1cf903587f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115301
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This reverts commit a6141ff5c9.
Reason for revert: Blocking Dart SDK -> Flutter engine roll. See logs here: https://github.com/flutter/engine/pull/11836/checks?check_run_id=210988794
Original change's description:
> Add dart2native tool for building either an aot file or a stand-alone executable.
>
> *dart2aot has been rewritten in Dart accompanied by a trampoline script.
> *dart2exec is still missing implementation.
>
> Change-Id: I4b662ce86c7365fa4d043b48a691881c8ef08a8c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108601
> Commit-Queue: Sarah Zakarias <zarah@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>
TBR=cskau@google.com,zarah@google.com
Change-Id: I4c5946ce0f0a66484e243b98cdcb7e2b24e2d705
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Checking if an interpreted frame is marked for lazy deopt while
preparing to handle an exception was causing an assert to be hit. We
can skip this check for interpreted frames.
Fixes https://github.com/dart-lang/sdk/issues/38003.
Change-Id: Icea65868c6291864df93920fa25236bcc36fded5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115268
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
_Closure objects are created by the VM "magically", without invoking
constructor. Usually nullability of fields is calculated when compiling
a constructor, but constructor of _Closure is not compiled. With AST
nullability is also derived from field initializers, but this is not
the case in bytecode mode (as there are no initializers for instance
fields unless they are needed for hot reload).
Fixes language_2/bound_closure_equality_test with bytecode
and --optimization-counter-threshold=5.
Change-Id: If86a276c875f798af8511038326714e66e212cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115300
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Rationale:
The limit on the number of classes is the same as the number of methods
per class, leading to exponential growth of the generated program if
this limit is raised. This patch introduces an optional parameter to
increase the limit separately for different use cases.
Change-Id: Id74d00a47494162a67fd980c163243690c5c1ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115004
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
The test `pkg/front_end/test/flow_analysis/type_promotion/switch.dart`
wasn't running because it was declared in the wrong place (it should
have been inside the `data` directory). Merge it with the existing
test file `pkg/front_end/test/flow_analysis/type_promotion/data/switch.dart`.
Change-Id: Idc98464d88001ce68274a29ed73d02f6c378abc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115263
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The crash occurred when:
- The body of the for-loop contained a write to a variable that was
declared inside the body of the loop.
- At least one variable was declared outside the for-loop.
Fixes#37983.
Change-Id: I241312e1f1c9efb879bbff93fc0ca569d8ec8370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115262
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>