This can be used by the front end to detect when to add synthetic
break statements to switches involving patterns.
Bug: https://github.com/dart-lang/sdk/issues/50624
Change-Id: I783b0920b8dc6ccbc7af8062fba7bfdeaa9dd9cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In
b2889872c3,
the switch expression syntax was changed so that it no longer uses the
`case` keyword.
Change-Id: I97c10b3462b5849e1baf386df81a656d5ac25c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273623
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I1ebb2ea12f4d01c4077fca6fc380353f821bc68a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267422
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
When asking for all references of a member it starts by finding all
supertypes for the class, then for each supertype (including itself)
(that has a member with the same name as the one we're querying for)
it searches for all subtypes.
We recall that when getting all subtypes, it really gets all direct
subtypes, then for each of those, their direct subtypes etc.
Naturally, then, with getting all subtypes for all supertypes we
will often ask for all direct subtypes of the same class several times.
In fact, it's O(n^2):
As an example, if asking for references to `foo` on this
(in a file in analyzer, with 8 workspaces):
```
class X0 { void foo() { print('hello'); } }
class X1 extends X0 { void foo() { print('hello'); } }
class X2 extends X1 { void foo() { print('hello'); } }
[...]
class X149 extends X148 { void foo() { print('hello'); } }
```
we ask for subtypes 90600 (150 classes * 151 / 2 * 8 workspaces) times.
This CL stops that from happening and in the example from above we
"only" asks for subtypes 1200 (150 classes * 8 workspaces) times.
For the `newFile` from `AbstractSingleUnitTest` example, for instance,
we go from 28,264 asks to 17,432 asks (a ~38% reduction).
Non-first runtimes when asking for references:
Before:
0:00:03.074853
0:00:03.021881
0:00:03.034707
0:00:03.115596
0:00:03.032574
After:
0:00:02.223978
0:00:02.149937
0:00:02.150236
0:00:02.104704
0:00:02.175859
Difference at 95.0% confidence
-0.894979 +/- 0.060283
-29.2867% +/- 1.97266%
(Student's t, pooled s = 0.0413338)
Change-Id: Id792a595e74de01c7186ab1263c38728f051f603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272623
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Generate type hierarchy rules for all interface types used in a
module. These rules are utilized by the `isSubtype()` to determine
interface subtypes.
Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I63f64075d4947f234eca5e730ad15588e60b9e1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266542
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Preparation for separating type representation from classes.
Use `JS_CLASS_REF(_RecordImpl)` to inline a reference to the class
in JavaScript (not the type representation).
Use a standard Dart `is _RecordImpl` type test and let the compiler
produce the correct type test code.
Change-Id: I160312d61137ad0c6b2aa30b8aeba4acbe848df9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273523
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
RegExp code objects keep backtracking and registers stacks in object pools, can't be shared between isolates.
BUG=https://github.com/dart-lang/sdk/issues/50082
TEST=one_regexp_many_workers
Change-Id: Ic7db8d7a75a0951178b2f4800f96224d52506545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
From the changes in dart-lang/language#2674 that specify from a certain language version, we would like classes to not be used as mixins unless specified as a 'mixin class'.
Currently, this behaviour is under the sealed-class flag. May be subject to change as the other modifiers are added, but I'd at least like to make sure this works for sealed classes.
Change-Id: I5754b383327dde06d49175fe2d05c8ba7462145f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Add an example where the source future results in an error that is ignored, with
only the `TimeoutException` surfacing in a catch block.
Move some comments to the same line as the `print` call to match other
lines in the example code. Use doc comment syntax on functions in the
example code.
Change-Id: I5d3146ebe8f7edce303d76ff36822ced9b831c95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272960
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
collection (efd709f..caf6802):
caf6802 2022-11-28 Nate Bosch Tweak docs for split extensions (#256)
fixnum (bca3816..62916f2):
62916f2 2022-11-24 Lasse R.H. Nielsen Split into separate libraries instead of using parts. (#97)
14d4827 2022-11-23 Lasse R.H. Nielsen Add `tryParse` methods. (#96)
http (047d6ed..976bd56):
976bd56 2022-11-28 Kevin Moore Use latest mono_repo (#832)
protobuf (c181573..4f3e328):
4f3e328 2022-11-30 Devon Carew Emit imports in sorted order (#778)
3cc088e 2022-11-28 Kevin Moore Latest mono_repo (#779)
sse (8d018dd..d396145):
d396145 2022-11-29 Elliott Brooks (she/her) Fix Fetch credentials (#69)
stack_trace (dce0013..cf3562e):
cf3562e 2022-12-01 Devon Carew blast_repo fixes (#123)
test (b25dac9..f3d80a6):
f3d80a68 2022-11-29 Nate Bosch Fix missing label and reason after isNotNull (#1797)
5b1f0075 2022-11-29 Nate Bosch Use double quotes for test names on windows (#1802)
986045c4 2022-11-29 Nate Bosch Temporarily pin to ubuntu 20.04 (#1800)
webdev (637b406..91b8a19):
91b8a19 2022-12-01 Elliott Brooks (she/her) Fix global variable `isInternalBuild` in injected client (#1805)
7d0810a 2022-11-30 Elliott Brooks (she/her) Updates the `fixture` package `pubspecs` so it is clear what shouldn't be migrated to null-safety
(#1803)
acd3f9f 2022-11-30 Elliott Brooks (she/her) Can debug with the MV3 Dart Debug Extension (#1802)
1258510 2022-11-29 Elliott Brooks (she/her) Detect whether the Debug Extension was built for dev or release (#1800)
b4a23c6 2022-11-29 Elliott Brooks (she/her) Fix Fetch API implementation (#1801)
67133df 2022-11-29 Elliott Brooks (she/her) Pull out debug logging into one file (#1799)
a395c68 2022-11-28 Elliott Brooks (she/her) Handle detecting Dart app when tab changes (#1796)
4fb4328 2022-11-28 Elliott Brooks (she/her) Authenticate the user when they click on the Dart Debug Extension icon (#1795)
Change-Id: I7beeeb43de4ba514817836ffd4ff6a62b801f2dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273282
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The tutorial doc was mistakenly _not_ in the doc/ directory.
The icons show up as way too big, so I use inline HTML to specify
their width, so that they look good inline.
I add light mode icons, and use GitHub (and dartdoc)'s support for
switching between light mode and dark mode images.
https://www.stefanjudis.com/notes/how-to-define-dark-light-mode-images-in-github-markdown/
Change-Id: I1a368bfc6628adf941ba5e7a752317f9757d2538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273460
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
When the heap limit is reached, directly unreachable objects are reclaimed but objects that will be unreachable after a finalization are not, and there needs to be enough headroom between opportunities for finalizers to run (returning to the event loop).
So only do the finalization thing with the upper, high-mutation part of the splay tree and remove it from the lower, write-once part. The high-mutation part is what's more interesting for GC stress testing.
Bug: https://github.com/dart-lang/sdk/issues/50597
Change-Id: Id02b38b0ac1e9bb640954ef1b686ce3eef8370af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273300
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Before we could get into a situation where we didn't produce the entire
class hierarchy when we loaded from dill even though we set up the
entry points correctly.
This might not be perfect, but seems better.
Change-Id: Ifc56930da7ccad52e96ae32d6a8ab509421b37b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Expressions can also occur in patterns, either after an equality or
relational operator (e.g. `== e`), or after `const` (though what's
allowed after `const` is heavily restricted). We need to make sure
that the expression parser doesn't greedily treat `=>` as introducing
a function expression when parsing these constructs inside a switch
expression.
But it's ok to allow function expressions inside list patterns, map
patterns, parenthesized patterns, and in the argument part of object
patterns. (These will be rejected by a later stage of analysis
because expressions inside of patterns must be const, and a function
expression can't be const. But the parser should still accept them so
that we can give useful error messages).
Fixes#50591.
Bug: https://github.com/dart-lang/sdk/issues/50591
Change-Id: I828555782f5bc8cb8aae8a3948849b7a75bdec57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273286
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The parser now handles maps that contain rest patterns with
subpatterns (e.g. `{'foo': _, ...var rest}`). Even though this is
invalid Dart, it still makes sense for the parser to handle it so that
we can generate higher quality error messages.
The shared type analyzer now generates an error,
`restPatternWithSubPatternInMap`, if it encounters this error
condition.
Change-Id: I7f447bde28e646593aa432e3e5ad1f5e415bdd30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273283
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Mostly to don't crash when running co19 tests.
Change-Id: I62838d04872642b2e3a9ed01a1be120aec1c0608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This is targeted at the lint `avoid_returning_null_for_void` which already complains about expression function bodies but the fix doesn't do anything for them.
Change-Id: I14f3d7659301edae08482d9ffa6b72b483737e59
Bug: https://github.com/dart-lang/sdk/issues/45920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>