Change-Id: Ibe0741d360caa4747ad4a3eea888b1a9661af111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277050
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
- Make _apply args non-nullable
- Use null-aware operators instead of conditionals
- apply uses mutable and immutable locals, mark immutable ones as
`final`
- Remove uses of `new` keyword
Change-Id: Ia6f40b6bee5f873a1814a4989375e46b2f8b99eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276642
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
emitter is a module name, so we use a different name here to avoid
a collision when using the module name. This CL regenerates dart:html
after accounting for https://dart-review.googlesource.com/c/sdk/+/276560.
Change-Id: I1c9d3a54a5f37a5e42cd5b79bbc3d635b98c198e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276763
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Continuation of 181c996. Overriding `_BoxedBool` runtime type turned out
to be a bit tricky, as explained in comments.
New passing tests:
- co19/Language/Expressions/Booleans/runtime_type_t01
- co19/LanguageFeatures/Enhanced-Enum/semantics_A07_t01
- language/type_object/first_class_types_literals_runtime_1_test
- language/type_object/first_class_types_literals_runtime_2_test
- language/type_object/first_class_types_literals_runtime_test
Change-Id: Icdd3eb61989298f70bfd6dca42a029fcc1ae9ec2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276502
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
The representation of record shape in record instances and record
types is changed from a pair
int num_fields
Array field_names
to a single integer - packed bitfield
int num_fields(16)
int field_names_index(kSmiBits-16)
where field names index is an index in the array available from
ObjectStore.
With the new representation of record shapes:
1) Size of record instances is reduced.
2) Number of comparisons for a shape test reduced from 2 to 1
(shape test is used during type checks).
3) A few operations removed from Record.hashCode.
4) Type testing stubs (TTS) are now supported for record types with
named fields. Previously it was not possible to check shape of records
with named fields in TTS as TTS cannot access object pool and cannot
load field names array).
TEST=existing
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I7cdcbb53938aba5d561cd24dc99530395dbbea7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276201
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Runtime types of String, int, and double implementations are expected to
be `String`, `int`, and `double`, respectively.
Change-Id: I8f84ee2e8405c820a686d54449d3eb2db18eb52a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276643
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Plan is to make the class `final` with class modifiers,
assuming they do not affect lagacy code,
and change the declaration to an `inline class` on a record pair when possible.
Very few existing classes implement `MapEntry`, and they probably shouldn't.
It seem like they can safely be changed to not do so.
Change-Id: I97b94b3048c6fde205439bd7b1061de0cf34bc66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276521
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Revert "[vm/regexp] Copy, rather than share RegExp objects between isolates." is in patchset 1.
Isolate RegEx-sharing benchmarks show 24-100x improvements.
Bug: https://github.com/dart-lang/sdk/issues/50639
TEST=ci
Change-Id: I87943c9b9928869f7a20052cb0dc71d24ad36087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276240
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Changes `other._value` to `other.millisecondsSinceEpoch`,
which prevents crashing if provided with a different implementation
of `DateTime`.
Exposed by #58750.
Bug: https://dartbug.com/50750
Change-Id: I1dfc0bb4e8a44ef0df432c9a916a6620691e0547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276523
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
TESTED=Ran CQ dryrun and approved failures for co19 tests that will be updated soon.
Change-Id: Ic0dc5fc084b1d0f3fce80dd88062f879abd7b556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275840
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
The CFE rewrite for structs, unions, and abi-specific integers is now
done on the extension methods.
The other native types are implemented in the extension methods
directly.
TEST=test/ffi
Closes: https://github.com/dart-lang/sdk/issues/50714
Change-Id: I578325733e3cd66200e80949d47ff12a13115b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@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>
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 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>
This reverts commit c09f790d37.
Reason for revert: CI failures
Original change's description:
> [VM/CLI] Remove dartdev.dill
>
> Incompatible VM flags will no longer break the CLI when running from an
> AppJIT snapshot, so the fallback logic is no longer required. This CL
> thus removes dartdev.dill and the fallback logic.
>
> Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
> and https://dart-review.googlesource.com/c/sdk/+/178300
>
> Fixes https://github.com/dart-lang/sdk/issues/50504
>
> TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
> and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
> both worked.
>
> Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>
TBR=bkonyi@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I5117f990dfabf93f5a9bae56098831280845e84e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275181
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
The doc refers to the `this` as "this", "parent", "current zone", and
"forking zone". Fix a typo "current's zone" -> "parent zone's".
Change-Id: I6d61ad5c69c2cc415ce7271831c7a364715b0652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274280
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This reverts commit 4981cbffe2.
Reason for revert: Mac regression test failed.
Original change's description:
> [ VM Service / DDS ] Add custom service stream support
>
> Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.
>
>
> The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.
>
> TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients
>
> https://github.com/flutter/devtools/issues/4533
>
> Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>
TBR=bkonyi@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,danchevalier@google.com
Change-Id: Ia1dce25444a6329c0553c931c9a6dbbec65ee583
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274802
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Use the "extension type" class as the interceptor object for the
dart:_rti library. This applies to the new type system for values
that are represented as a native JavaScript type. For example:
Number, bool, String, Array, etc.
Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: Ie6214aa897d3ae8abb4f9619cd2be984eeb9c4ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266544
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.
The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.
TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients
https://github.com/flutter/devtools/issues/4533
Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
This reverts commit d9ea7207e8.
Reason for revert: b/261854137
Original change's description:
> [ddc] Wrapping loadLibrary checks in a future to obey eval order rules
>
> These checks are cosmetic right now in DDC, but the load check was happening synchronously rather than after the future returned by loadLibrary completed.
>
> Change-Id: I867779605ddfe4f63b83b47418994e0c5e68572a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274087
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>
> Reviewed-by: Anna Gringauze <annagrin@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: If7e19644498835d0f77569ce11a2438f4d012f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274362
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
The current two-level indexing scheme for function type parameters
(depth and index) breaks down in the case of type substitution when
the substituted type is a generic function type, since its internal
type parameter types have been encoded assuming that the function type
had nesting depth zero, but after substitution its nesting depth can
be higher.
Relative indexing schemes such as De Bruijn indices will also not
work, since function type parameter types are constant types, and the
constant infrastructure assumes that the same constant always has the
same representation.
This change introduces a flat indexing scheme where function type
parameters are indexed using a single index which is independent of
the context in which the type parameter type appears. To avoid
collisions in the case of nested generic function types, every function
type has a type parameter offset, which conceptually shifts the
indexing range of its type parameters so it doesn't necessarily start
at zero.
Looking up a function type parameter in its environment thus involves
searching outwards until a function type is found whose type parameter
index range contains the index encoded in the function type parameter
type.
Change-Id: I544056d52711ff829b170f78a7274a93871825a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272361
Reviewed-by: Joshua Litt <joshualitt@google.com>