This reverts commit f30e5de558.
Reason for revert: https://dart-review.googlesource.com/c/sdk/+/274921 broke customer test, and this CL sits right on top of it.
Original change's description:
> Remove preview-dart-2 option in analysis options
>
> Fixes https://github.com/dart-lang/sdk/issues/50680
>
> AnalysisOptionsHintCode is moved from generated `option_codes.g.dart` to `option_codes.dart`, for non-generated diagnostics:
>
> * AnalysisOptionsHintCode.DEPRECATED_LINT_HINT and
> * AnalysisOptionsHintCode.DUPLICATE_RULE_HINT
>
> Change-Id: I131fb2901fca26ff971b6c9c519ab2f0b983a65c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275500
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ia417aa5edc5b279a5fced43154de4cd5c9d3be2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276023
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
It is being removed in Dart 3.0 and a `TypeError` should be used
instead. This is true in legacy code as well and all test
expectations will be updated.
Change-Id: I021fa4ecb1a9bbc404598113c65349e17926cd91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275782
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This brings test.py into agreement with build.py, and makes development on arm64 hosts nicer.
Change-Id: Ic544b4eee0e27d9f395328297ed6108d4e4689f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257800
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
These tests have some exceptions caused by missing fields on the
dynamic variable. The exceptions cause the `isolate.resume()` call to
not run, which also cause the test body to not complete.
Currently this is masked by the test runner, which immediately ignores
the test body once the first error occurs. That behavior is changing,
and a failure will not immediately end a test when the body is still
running. https://github.com/dart-lang/test/pull/1815
Some of these tests are currently are expected to fail, but not to
timeout. Fix the test implementations to more reliably complete the test
body, even when the test had an error. This does not fix the tests
themselves, it maintains the current pattern of failure, even after
updating the test runner.
- Use `Stream.firstWhere` over cancelling the stream subscription after
the first breakpoint.
- Use `Future.whenComplete` to ensure the isolate is always unpaused,
including after an exception in the expectations.
Tested: Passes with updated test runner in https://dart-review.googlesource.com/c/sdk/+/275401/4
Change-Id: If5a7f0264c580cb38bcc1bd95c035aaf5644124b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275787
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Towards https://github.com/flutter/flutter/issues/93676
Flutter uses an extension for hot reloads, and the app ends up running
in the root zone after a hot reload because that is the zone that the
handler gets called in.
Always run extension handler callbacks in the zone from which they were
registered for more predictable behavior.
Change-Id: Ia921489a6ada802c8e53a0ccc650a8bce218ba01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275842
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This API allows embedder to append arbitrary footers to DWARF stack
traces. For example, embedder can append a link to a symbolizer
service, which could be used to symbolize the stack-trace.
TEST=manually tested, hard to create automatic tests because vm/cc tests only support JIT, not AOT.
Bug: b/255741575
Change-Id: Id034b9b3194f7b91a8405574ea771c4a06fda2c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This CL allows the heap snapshot tool to load a file as it is launched
via a command like
```
../../../out/ReleaseX64/dart bin/explore.dart my_snapshot.heapsnapshot
```
Change-Id: I4eca4ec18daef4d3361c754018d234045e725ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275860
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This deprecated class cannot be removed just yet because
we still need to throw something in case of cyclic initialization
in Dart legacy libraries (which are still supported).
Class CyclicInitializationError is copied for each implementation
(VM, dart2js and DDC) and made private. Each implementation now has
an independent private class which can be removed separately.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I8100bbe16636c12c4cbabbb5fe770f4c648c4249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275120
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Migration tool currently crashes if a class overrides
some methods it got by adding a mixin.
Added a test for that and fixed the crash, the fix
boils down to casting to just `InterfaceElement` instead
of `ClassElement`.
Tested: added a new test
Change-Id: Iab5ddb26c4930ed2020d6f3caa0710e55f24d8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275721
Commit-Queue: Ilya Yanok <yanok@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Language specification (section 17.2) says two strings are identical
when they're both constants and equal.
It doesn't mention adjacent strings, but looking at the tests, it seems
like juxtaposition of constant strings are expected to be constants as
well.
This adds a special case in string juxtaposition compiler to handle the
case where parts of the adjacent strings are all constants.
New passing tests:
- co19/Language/Expressions/Instance_Creation/Const/canonicalized_t05
- co19/Language/Expressions/Strings/adjacent_strings_t02
- language/const/string_test
Change-Id: Ib46582be492ba20c417546cbfb4e67b2d90e3ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275200
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Avoids the VM later failing with a misleading "Out of Memory" message when allocation fails for lack of permission, etc.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50719
Change-Id: I52b2478092a5e5b59680f31d37ab3c6d6d816ba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275783
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
browser_launcher (5fa0bd6..2712dda):
2712dda 2022-12-13 Anna Gringauze Fix internal CI test failures (#35)
dartdoc (eb90a44..1f42216):
1f422163 2022-12-13 Sam Rawlins Bump to 6.1.5 (#3274)
intl (234b291..6fb07f2):
6fb07f2 2022-12-14 Copybara-Service Merge pull request #520 from dart-lang:revto18
1f9815c 2022-12-14 Moritz Rev version in preparation for publish of 0.18.0
1d37c42 2022-12-13 Googler Internal change
708b85c 2022-12-13 Copybara-Service Merge pull request #498 from dart-lang:remove_intl_stream
2d9eca9 2022-09-28 moritz sort imports
08a35bd 2022-09-28 moritz Merge branch 'master' into remove_intl_stream
0fc6ab9 2022-09-28 moritz Changes as per review
4680742 2022-09-27 moritz rename to stack
f687c72 2022-09-27 moritz changes as per review
ef36013 2022-09-26 moritz add reference to benchmark
117c0cf 2022-09-26 moritz separate read and pop
434378a 2022-09-26 moritz move method
e98c4aa 2022-09-26 moritz fix typo
9234540 2022-09-26 moritz rename file
024cffc 2022-09-26 moritz make it a tad faster
c6f7b6a 2022-09-26 moritz some renaming
443c9e0 2022-09-26 moritz Remove StringIterator
1953002 2022-09-23 Nate Bosch Inline the extension
4dfdc1b 2022-09-22 Nate Bosch Simplify the IntlStream class
mime (c0c4c47..273d454):
273d454 2022-12-13 tomk9 Add .dcm to extension map (#74)
aacec32 2022-12-12 Kevin Moore Update to latest lints, bump min SDK to 2.18 (#77)
536db4f 2022-12-12 Kevin Moore blast_repo fixes (#79)
2343229 2022-12-12 Kevin Moore Add .msj (and change .js) to text/javascript (#76)
mockito (347d3e4..942dd03):
942dd03 2022-12-12 yanok Override `SmartFake.toString` to be super-verbose
5f97a43 2022-12-09 Sam Rawlins Stop using deprecated analyzer APIs
0660e61 2022-12-06 yanok Generate method overrides even then source lib is not null-safe
cf7d851 2022-12-06 yanok Add override for `Object.operator==` in `SmartFake`
6b89e99 2022-12-02 yanok Automated g4 rollback of changelist 492410078.
d11d010 2022-12-02 yanok Generate method overrides even then source lib is not null-safe
sse (d396145..cfa93b1):
cfa93b1 2022-12-14 Elliott Brooks (she/her) Add `package:js` to dependencies (#71)
00335e4 2022-12-13 Elliott Brooks (she/her) Update `package:sse` to `4.1.2`(#70)
webdev (3e2364e..317288a):
317288a 2022-12-14 Derek Xu Remove ChromeProxyService.setExceptionPauseMode() (#1820)
bbe7143 2022-12-14 Elliott Brooks (she/her) Migrate `events_test.dart` to null-safety (#1819)
1d1c98f 2022-12-14 Elliott Brooks (she/her) Settings page, Dart Debugger panel, and Flutter Inspector panel match DevTools styles (#1815)
a9b8887 2022-12-13 Elliott Brooks (she/her) Update tests that are incompatible with `3.0.0` (#1817)
Change-Id: I08e555dc22e5577740fe43e91ff31e4601ac15f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275781
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
TypeParameter::set_index was already asserting for 16 bits but silently truncating to 8 bits. The size of TypeParameter does not increase due to allocation rounding.
Add explicit range check to class finalization.
TEST=ci
Change-Id: Id4017f74b7dba47b00d64e77e787712c70290dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Benchmarks improved by:
JIT:
RecordCollections.ListAddPoly.Record ~9.6 times
RecordCollections.ListSetIndexed.Record ~8.3 times
RecordCollections.ListSetIndexedPoly.Record ~16.1 times
RecordCollections.MapAdd.RecordKey ~3.6 times
RecordCollections.MapAdd.RecordValue ~4.4 times
RecordCollections.SetAdd.Record ~4.1 times
AOT:
RecordCollections.ListAdd.Record ~8.7 times
RecordCollections.ListAddPoly.Record ~8.8 times
RecordCollections.ListSetIndexed.Record ~19.5 times
RecordCollections.ListSetIndexedPoly.Record ~18.3 times
RecordCollections.MapAdd.RecordKey ~7.1 times
RecordCollections.MapAdd.RecordValue ~8.8 times
RecordCollections.SetAdd.Record ~8.9 times
TEST=vm/cc/TTS_RecordSubtypeRangeCheck
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I96e4c6a40a897a72b3570b59e014c8af77a9ef99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275082
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
TypeError is now expected in the place of NullThrownError which is
being removed in Dart 3.0.
Change-Id: Ibb7188d993216067650d4b994a303f2bcd1d2298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275742
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Fixes https://github.com/dart-lang/sdk/issues/50680
AnalysisOptionsHintCode is moved from generated `option_codes.g.dart` to `option_codes.dart`, for non-generated diagnostics:
* AnalysisOptionsHintCode.DEPRECATED_LINT_HINT and
* AnalysisOptionsHintCode.DUPLICATE_RULE_HINT
Change-Id: I131fb2901fca26ff971b6c9c519ab2f0b983a65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
These NoSafepointScopes are active for only one load/store where there is little need to guard against someone adding an allocation. They have been observed to take up to 15% of program execution in debug builds.
TEST=ci
Change-Id: I923baa28a3a72decacbfcdec3331ce9c7c620b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275540
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Now that 9df6656aa9 has appropriately propagated and the build rules in
google3 have been updated, re-add checks to ensure that the empty
section used to pad the original header exists and that the new header
is smaller than the old header.
Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: I5b8b31bf9edf4814686eb7928457a9a7d53c0727
Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-try,dart-sdk-mac-arm64-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-mac-release-arm64-try,vm-kernel-mac-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275622
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Previously, the client had to know that the relational operator should
be looked up in the matched value type. Now the shared analysis logic
requests the lookup and supplies the appropriate type.
It's a small change, and one might argue that it doesn't really move
around very much business logic, but it makes the tests more readable
so I think it's worth it.
Change-Id: I936d5f5f929f11800efe25974334c898c7e1072d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This change is necessary for large strings because otherwise we hit V8's maximum argument limit to a function.
Change-Id: I2473d1c5acd62f16d509752c437678c697e7ebeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275480
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This enables the front end to skip the old-style (enum-based)
exhaustiveness checking algorithm when pattern support is enabled,
because with pattern support enabled, switches on enums are required
to be exhaustive (this will be checked by the new exhaustiveness
checking algorithm).
That in turn means that in the future, when we remove support for
language versions that lack patterns support, we will be able to
remove the old-style exhaustiveness checking algorithm.
This change has a small effect on code generated by the WASM back-end
(the only back-end that uses `isExplicitlyExhaustive`): for a switch
statement that is exhaustive *and* has an unreachable `default`
clause, after testing all the cases, the WASM back-end will generate a
branch to the `default` case. Previously it would instead generate an
`unreachable` instruction. There should be no behavioural difference
because the instruction in question is unreachable in both cases.
Also, there should be negligible code size difference because the body
of the `default` case is being emitted either way.
Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: Id6bd7d9a540cb1b4d9c3624db8ff494438276bea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274924
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
A desired feature for flow analysis of patterns is that the matched
value type of one subpattern may depend on promotions from previous
patterns. For example, we want this to work:
int? x = ...;
if (x case null || < 0) ...;
This means that although the type of the scrutinee is `int?`, after
the subpattern `null` has been processed, type promotion should
promote the matched value type to `int`, so that the subpattern `< 0`
doesn't report an error.
This requires changing the API of the shared patterns analysis logic,
so that the client is no longer responsible for passing around the
matched value type. Instead, flow analysis keeps track of it and
provides it to the client when requested.
In follow-up CLs I'll add the necessary logic to flow analysis to
actually promote the matched value type in situations like the example
above.
Change-Id: I6ce66962af32f9bd93bfe4082ba256de627d3cc6
Bug: https://github.com/dart-lang/sdk/issues/50419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274942
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The test stacktrace_current compares two stack traces by masking any
line numbers.
With dart2wasm, V8 shows function offsets instead of line numbers, in
hex, which causes the test to fail with unrelated changes.
This updates the regex to mask hex numbers as well, making the test
stable with unrelated dart2wasm changes.
Change-Id: I8dd951d4bf29fe39b6ec5d8de7bf2c9c37a5b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275600
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This updates the exhaustiveness implementation to have specific static
built-in types for nullableObject (the top) and its underlying nonNullableObject,
nullType and its underlying neverType. In the previous encoding, the top
wasn't nullable (if you queried the isNullable property) but was still
assumed to contain `Null` in other parts of the code.
With this change, the top space is now an ExtractSpace based on
StaticType.nullableObject, the empty space is an ExtractSpace based on
StaticType.neverType and record spaces are based on
StaticType.nonNullableObject.
The StaticType is now split into a StaticType interface and a
StaticTypeImpl implementation class for the non-built-in types. This
prepares for integrating the exhaustiveness checking with the analyzer
and CFE where the properties of the sub/supertype relation and fields of
the StaticType needs to be computed lazily.
Change-Id: I5a6919d7cba356f9bc8ac3f69fd3ac2b41319e9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274020
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
These are scattered changes to get to type inferrence.
- Add some impact tracking for used record types
- Add RecordTypeInformation and FieldInRecordTypeInformation
- Add a simple test to show inference is currently very conservative.
Change-Id: Icb81033b11588c1bddd01c8c5fcf69950fdb77e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275161
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>