- DartDev will now be rebuilt when changes in DDS are made
- Building the `create_platform_sdk` target will build all non-web
components of the Dart SDK, allowing for shorter build times when not
developing web tooling.
Change-Id: I605df4893e93010ba0c0bab0593fb840f1859c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147807
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Gives good speedups, especially for short strings. Average speedup for
the TwoByteString cases were measured to:
Length IA32JIT X64JIT ARMv7JIT ARMv8JIT X64AOT ARMv7AOT ARMv8AOT
10 152% 402% 120% 102% 148% 106% 118%
10k 46% 223% 14% 13% 72% 49% 65%
Closes https://github.com/dart-lang/sdk/issues/41704
Change-Id: I31f716f6582e6fa8e33421e6874e852a3a3362e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146785
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Also base these and the corresponding methods in _OneByteString on
functions in dart:_internal, so they can be used in other patches.
Change-Id: Ibced31758db2959c111a01cdaa46df2971ae4a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146784
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bug: https://github.com/dart-lang/sdk/issues/35253
This API was suppressed initially due to issues with conversions
between promises and futures. Now that that has been resolved, this
should be unsuppressed. Tests have been refactored to use both
navigator.getUserMedia and navigator.mediaDevices.getUserMedia.
Change-Id: Ia131b303192c7eaa3f08475cf700a53665ab3584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
The bad arity maybe detected after an isolate reload or when using strong mode with a mix of opted in and opted out libraries.
The thrown NoSuchMethodError contains enough information to be useful, but does not mirror the complete invocation (e.g. arguments).
This CL does not fix https://github.com/dart-lang/sdk/issues/37517 where the target is missing after a reload (not just bad arity).
The VM implementation of NoSuchMethodError is cleaned up, but the deprecated constructor 'NoSuchMethodError(...)' is not yet removed, since it is still documented.
Change-Id: I0306971c59cb510d21cb1b1acc3545c8817dfea7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146986
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
To enable our tests to spawn a new isolate in a new group, this CL
adds a `{bool newIsolateGroup}` parameter to the internal
`Isolate._spawnFunction` native and moves that native to
`dart:_internal`, thereby allowing runtime/tests/vm/dart/* to access it.
It also adds various tests for lightweight AOT isolates, exercising
GC, communication, spawning, ...
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I3940c30fb43d2475c58e6be78507da74ce64b60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145941
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
createContextualFragment accepts a non-nullable string, so if html
is null, it's called with 'null'.
Change-Id: If11a4c397c939017f501707130385d967ee05910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146691
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Removes the Closure.clone() in sync* by adding an additional closure
around the rewritten sync* function body.
This is a re-worked version of the now reverted:
- https://dart-review.googlesource.com/c/sdk/+/136190
- https://dart-review.googlesource.com/c/sdk/+/144948
This CL includes changes from both the above CLs, in addition to:
- A new 'ShadowRewriter' transformer to do deep rewriting of
shadowed parameters.
Previous versions only rewrote the immediate sync* function, missing
references in nested rewritten functions.
Note: This CL is re-landing largely unchanged since the roll-blocking
issues suspected to be caused by this was later attributed to a
different set of changes.
I have independently re-run all failing external tests to verify
them passing for this CL.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Id1670a93961180e8558d7c7eca65fe7e9115f07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145402
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Currently the VM only accepts an `_InvocationMirror` instance, not a user created `Invocation`.
Fixes#33124
Bug: http://dartbug.com/33124
Change-Id: Ifdc95861cbe632bc317ca8d9fb92cf0d3ae600f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This brings JSON encoding and decoding in line with the UTF-8 changes
described at https://github.com/dart-lang/sdk/issues/41100
The fused UTF-8 / JSON decoder for the VM now uses the new UTF-8 decoder
instead of its own, separate UTF-8 decoder.
The JSON encoder now escapes lone surrogates, so it can encode JSON
string values containing lone surrogates while keeping its output valid
UTF-8.
Change-Id: Ie4d4601cf84012068849e64d4670f2dcd49ea088
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144286
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Two-pass decoder: the first pass scans through the input to compute
the length of the resulting string and which decoder to use, and the
second pass does the actual decoding.
The same decoder is used for both one-shot and chunked decoding, and
both with and without allowMalformed. If there is an error in the input
and allowMalformed is true, it starts over with a general decoder that
supports malformed input and allocates space as it goes along.
JS targets go directly to the general decoder, as the two-pass approach
is not beneficial here.
Three pieces of the decoder are designed to be pluggable by patches to
optimize the performance further:
- scan, running the first pass of the conversion.
- decode8, decoding Latin1 data into a OneByteString.
- decode16, decoding arbitrary data into a TwoByteString.
Improves decoding speed, especially for complex input (many multi-byte
characters). Observed speed increases are approximately:
- dart2js: up to 40%
- VM JIT: up to 260%
- VM AOT: up to 130%
The constant overhead of calling the UTF-8 decoder is also significantly
reduced for dart2js.
Code size for dart2js is slightly reduced compared to the old decoder.
ASCII inputs currently see a slight speed decrease for VM targets, which
will be fixed in https://dart-review.googlesource.com/c/sdk/+/145460
This is part of the implementation of the breaking change described at
https://github.com/dart-lang/sdk/issues/41100
Closes https://github.com/dart-lang/sdk/issues/28832
Closes https://github.com/dart-lang/sdk/issues/31954
Ideas for further improvements to the decoder are collected in
https://github.com/dart-lang/sdk/issues/41734
Change-Id: I3c5bb84e8d6783231680a9d34d6c38e8a28ab112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142025
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
We have accumulated almost 69 commits. Please see issue
https://github.com/dart-lang/sdk/issues/41739
for details of why these CLs had to be reverted.
Revert "Reland "[vm] Make VM support .dart_tool/package_config.json""
This reverts commit fa6cc57a32.
Revert "[VM] - Fix hang when no package config or .packages exist"
This reverts commit 31be795457.
Revert "[vm/isolate] Make Isolate.resolveUri() work for both `.packages` and `dart_tool/package_config.json`"
This reverts commit a99f7aef6e.
Revert "[vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs"
This reverts commit 7082e99c28.
Revert "[vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)"
This reverts commit 708468684a.
Change-Id: Id6b951bde4f379fdcfac3cc23e0057a77a7e6db0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
When package config or .packages file is missing and a test is
run the VM goes into an infinite loop in _findPackagesConfiguration
Change-Id: Ic920a401cbbac73bcffcac68ab358fb6246ff8c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145661
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Closes#40692
Allows a better pattern for parsing user input than catching an
`ArgumentError`.
- Add a new static method to InternetAddress and implement it in all
patch files.
- Add tests which match the tests for the constructor.
Change-Id: Idc76fc4875578f7a381219c0e7e12d1931d98fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136406
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Supercedes previous work here: https://dart-review.googlesource.com/c/sdk/+/128849
Change overview:
* In legacy mode, the isRequired flag for parameters in the kernel IR is treated as false (though this bool is still processed during serialization).
* Adds a Set<String> to the element model to represent required-ness. All named parameters are still stored in a single "bag".
* ParameterStructure objects additionally emit/ingest all required named parameters as well during serialization.
* A bool indicating whether or not a parameter is required is emitted after each named parameter when serializing FunctionTypes.
* JS identifiers for functions with required named parameters now emit '$req' before each required named parameter. E.g., dynamic_Function_String_$named_p0_int_$req_p1_int for dynamic Function({int p0, required int p1}).
* Recipes now indicate required named parameters with '!' instead of ':'. E.g., @(int,{p0:int,p1!int}) if p1 is required and p0 is optional.
* A requiredNamedSeparator was added to the shared recipes to accommodate the above.
* The RTI now represents named function parameters as a repeating list of triplets (name/bool/type). This adds a bit of overhead to our parser but makes subtype checks simpler.
* Does NOT include changes to Function.apply + auxiliary information attached to closures. These will be added in a later patch.
Fixes#39730
Change-Id: I9c9eaac28da0d63bb16bdb439f021f1470539563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141204
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Opt-in code can have Never types even with legacy subtyping.
Bug: 41675
Change-Id: I6dbdc064dceeedf0774d10faaca336561b41b7d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145561
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
This CL makes the VM add support for .dart_tool/package_config.json via
* the --packages=<file> command line parameter
* the `packageConfig: <file>` parameter to `Isolate.spawnUri`
It also allows now `package:*` uris being used in `Isolate.spawnUri`
The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.
The CL also aligns the implementations between sdk and sdk_nnbd more.
Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246
Change-Id: I0a7aa3040332abafa19bf80bdbd8a8f8594cc6fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145462
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This change reverts an accidental breaking change in 6a5b87f where the
HTTP parser rejects characters in HTTP header values that it wouldn't
send itself.
This change restores the previous behavior of decoding these characters
as Latin-1.
Fixes https://github.com/dart-lang/sdk/issues/41688
Change-Id: I02bae07b5721eb4cbec789ad912c7fe6e2b2b015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145244
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
This reverts commit 1bf25798fa.
Reason for revert: Rolling back as it breaks more external targets and is currently blocking rolls.
Original change's description:
> Reland "[VM] Remove unnecessary Closure.clone() from sync*."
>
> This reverts commit 430c75b5fa.
>
> Reason for revert: We probably don't care about the dartkb breakages.
>
> Original change's description:
> > Revert "[VM] Remove unnecessary Closure.clone() from sync*."
> >
> > This reverts commit ca94ad7112.
> >
> > Reason for revert: Appears to break dartkb.
> >
> > Original change's description:
> > > [VM] Remove unnecessary Closure.clone() from sync*.
> > >
> > > Instead, this CL wraps sync*'s sync_op in an additional function
> > > that captures local copies of the necessary closure state.
> > > Notably this state includes the parameters of the original sync* function
> > > as these also need to be cloned for each instance.
> > >
> > >
> > > Note: a large number of .expect files have a small number of changes
> > > due to the additional wrapper function, as well as some extra plumbing.
> > >
> > > Bug: https://github.com/dart-lang/sdk/issues/37753
> > > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> >
> > TBR=vegorov@google.com,cskau@google.com
> >
> > Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> > Reviewed-by: Clement Skau <cskau@google.com>
> > Commit-Queue: Clement Skau <cskau@google.com>
>
> TBR=vegorov@google.com,cskau@google.com
>
> Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>
TBR=vegorov@google.com,cskau@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: I879df17bd282d01468fa010b94a8c89afdb8cd0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145361
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
- Expose the internal runtime flag for the Null Safety mode.
- Add a guard to protect against accidental configurations
that set the mode multiple times.
Change-Id: I8d16a3c7bd8590ea6f2fee9b6f8c09009898a64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144991
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This CL makes the VM add support for .dart_tool/package_config.json via
* the --packages=<file> command line parameter
* the `packageConfig: <file>` parameter to `Isolate.spawnUri`
It also allows now `package:*` uris being used in `Isolate.spawnUri`
The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.
The CL also aligns the implementations between sdk and sdk_nnbd more.
Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246
Change-Id: Idec0990c731f34efda9c39672067eae9174319f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144826
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 430c75b5fa.
Reason for revert: We probably don't care about the dartkb breakages.
Original change's description:
> Revert "[VM] Remove unnecessary Closure.clone() from sync*."
>
> This reverts commit ca94ad7112.
>
> Reason for revert: Appears to break dartkb.
>
> Original change's description:
> > [VM] Remove unnecessary Closure.clone() from sync*.
> >
> > Instead, this CL wraps sync*'s sync_op in an additional function
> > that captures local copies of the necessary closure state.
> > Notably this state includes the parameters of the original sync* function
> > as these also need to be cloned for each instance.
> >
> >
> > Note: a large number of .expect files have a small number of changes
> > due to the additional wrapper function, as well as some extra plumbing.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > Commit-Queue: Clement Skau <cskau@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
>
> TBR=vegorov@google.com,cskau@google.com
>
> Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>
TBR=vegorov@google.com,cskau@google.com
Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
We were only treating Object as a top type if NNBD was disabled. This is
incorrect and we should be treating Object as a top type whenever legacy
subtyping is in effect. In particular, Object acts as a top type in weak
mode.
Change-Id: I76acc25e92fda2b9e2b7872fc72d319161318874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144689
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This reverts commit 87ce4a504f.
Revert "[vm] Make VM support .dart_tool/package_config.json"
This reverts commit b112aa0d8b.
Reason for revert: Failures on Windows
Change-Id: I3e4f601d7638b25df313773e525c9284737fa729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144985
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This CL makes the VM add support for .dart_tool/package_config.json via
* the --packages=<file> command line parameter
* the `packageConfig: <file>` parameter to `Isolate.spawnUri`
It also allows now `package:*` uris being used in `Isolate.spawnUri`
The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.
The CL also aligns the implementations between sdk and sdk_nnbd more.
Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246
Change-Id: I642dfb89f82b3f2c1613e443850bf0b4fb91f4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144766
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit ca94ad7112.
Reason for revert: Appears to break dartkb.
Original change's description:
> [VM] Remove unnecessary Closure.clone() from sync*.
>
> Instead, this CL wraps sync*'s sync_op in an additional function
> that captures local copies of the necessary closure state.
> Notably this state includes the parameters of the original sync* function
> as these also need to be cloned for each instance.
>
>
> Note: a large number of .expect files have a small number of changes
> due to the additional wrapper function, as well as some extra plumbing.
>
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,cskau@google.com
Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Instead, this CL wraps sync*'s sync_op in an additional function
that captures local copies of the necessary closure state.
Notably this state includes the parameters of the original sync* function
as these also need to be cloned for each instance.
Note: a large number of .expect files have a small number of changes
due to the additional wrapper function, as well as some extra plumbing.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Only removing checks for common calls within the type system that
we know are always safe.
Added `@notNull` on arguments typed to be non-nullable (in the nnbd
version) to avoid producing the null checks.
Added `Object` type to arguments to match the return type and avoid
casts when returning.
Change-Id: I05de45a8d923497f7340348ef2c0b9f72da5414b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143862
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Various optimizations to the null safe dart:async sdk to fix
performance regressions in dart2js.
Change-Id: I32c64b54be196ac18946ade45de6b352a20be832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144302
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Closes https://github.com/dart-lang/sdk/issues/41616
When merging interfaces, nullable and non-nullable types
should not be treated as the same. This also fixes some nullability
information that was not included in dart.idl but is part of the
Chromium IDL.
Change-Id: I6e94176d905b63364bc93dc2120d194452cf05f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144464
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Added a private RPC, _yieldControlToDDS, which DDS invokes once
connected to the VM service. Once this method is called, the following
happens:
- The VM service stops accepting new web socket requests.
- The VM service enters single client mode, where DDS is the single
client.
DDS can only place the VM service in single client mode when it is the only
VM service client. If other clients are connected, DDS will fail to start and
throw an exception.
The purpose of this change is to simplify state management between the
VM service and DDS. The plan is to delegate the following features to
DDS:
- Service extension management
- Custom client name support
- Isolate resume coordination for multiple clients
Change-Id: I0b3143710d94ee9444a4894e24555f7ed1caf5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142564
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This copies the logic from dart2js and brings the two patches closer
together. There is no need to pass the error handler to the helper
function shared between `parse()` and `tryParse()`.
Update JS foreign function types in parseDouble to match the NNBD
version.
Fixes: https://github.com/dart-lang/sdk/issues/41613
Change-Id: I85d39f8ba6bd76459cf6263099983b8b96d3a669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144304
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
While I was referencing the dart2js implementation to fix a bug in DDC I
noticed an unused local variable here.
Change-Id: I4e6dfd961cbc54ee346f1796eb1b5184d3c01ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144347
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Each primitive type T has three variant of 'as' check for 'as T' (strong),
'as T*' (weak) and 'as T?' (nullable).
Change-Id: I6ef3c41d73b384d7d16fa0da0c5b9a1e9791d43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143884
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
For the cases of implicit bounds like `<T>` the default value
should be `dynamic` when instantiating and no type parameter is
provided. This change fixes this cases.
For explicit bounds like `<T extends Object?>` or
`<T extends Object*>` the default values should be `Object?` or
`Object*`. This change breaks these cases by defaulting to
`dynamic`.
Filed: https://github.com/dart-lang/sdk/issues/41539
I believe this is the correct trade off right now because the
implicit bounds like `<T>` are more likely to appear compared to
`<T extends Object?>` or `<T extends Object*>`.
Fixes: https://github.com/dart-lang/sdk/issues/41301
Change-Id: I53a22cf9de2d200f628f3ac0f6b0a6b1ab9ba3fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Fixes buildbot failures by running VM service and DDS service tests in
separate test processes.
This reverts commit 1f0c90868c.
Change-Id: I0ad9b2e6ccea4d5468dd4dcdde0e286bcbf820ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit 75e1f2a16e.
Reason for revert: Fix for dartdoc #1949 makes this no longer strictly necessary. While this leaves the underlying imports unfixed, I will instead file an issue against the engine.
Original change's description:
> Add html_common to .gni files.
>
> This will enable a fix to an unresolved export that causes Dartdoc
> to complain about all Flutter packages.
>
> Bug: https://github.com/dart-lang/dartdoc/issues/2143
> Change-Id: I634e21066420b100295989cf9bdcd35af91a617b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143020
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Commit-Queue: Janice Collins <jcollins@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/dartdoc/issues/2143
Change-Id: Ibe25eee8031b348d9260245daca84d9742fbb894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143402
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Treats the SDK and all application code as a legacy library when
running without enabling the null safety experiment.
- Copy all changes from the SDK fork and applies them to the existing
SDK (except the null safety syntax used in the library itself.
- Start emitting legacy types.
- Add a work around to avoid ever creating legacy or nullable versions
of types in the dart:_runtime library or in JS contexts. This should
be safely removed once the SDK is opted in to null safety.
Fixes: #40266
Change-Id: I6a029b676c3e35980a6bab876a348c35590df92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142904
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commit 6b2419ddaf.
Reason for revert: Failures on bots. Reverting.
Original change's description:
> [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
>
> This change adds stream forwarding to the Dart Development Service,
> allowing for clients to subscribe to service protocol streams with DDS
> instead of the VM service directly. DDS will maintain a single
> subscription for each stream as long as at least one client is listening
> to that stream. A DDS stream subscription will be closed when the last
> client listening to that stream either disconnects or calls
> streamCancel.
>
> This change also enables DDS for most of the Observatory services tests,
> excluding thoses which utilize:
>
> - Service extensions
> - Client naming
> - Client isolate resume synchronization
>
> Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I185e63eabca54a3dff49d4f5a8a126795cadfa80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Also add `legacyTypeRep<T>()` that is similar but performs
a shallow conversion to a legacy type.
Using this in compiler/dartdevc_native/ tests gives a better usability
instead of constantly wrapping and unwrapping types. It allows us to
avoid stripping off the legacy from a type when calling `wrapType()`.
Issue: https://github.com/dart-lang/sdk/issues/40266
Change-Id: I07225f18c253222b31203b0b110233a3e018a7d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142547
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This change adds stream forwarding to the Dart Development Service,
allowing for clients to subscribe to service protocol streams with DDS
instead of the VM service directly. DDS will maintain a single
subscription for each stream as long as at least one client is listening
to that stream. A DDS stream subscription will be closed when the last
client listening to that stream either disconnects or calls
streamCancel.
This change also enables DDS for most of the Observatory services tests,
excluding thoses which utilize:
- Service extensions
- Client naming
- Client isolate resume synchronization
Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This is a reland of 6b44c631ad
Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
>
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
>
> The default behavior in SDK is unchanged.
>
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>
Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: I6ced6c1248b3b6687f6c7d998e5206b2b385f00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142446
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This reverts commit 6b44c631ad.
Reason for revert: Tests timing out on Windows
Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
>
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
>
> The default behavior in SDK is unchanged.
>
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>
TBR=sortie@google.com,lrn@google.com,kustermann@google.com,mehmetf@google.com
Change-Id: I824a1845e82b5facb839109f74bb482e7095e313
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142363
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This can be configured by embedders by setting the `_embedderAllowsHttp`
variable. It can also be overridden by client apps by introducing a
`Zone` with the variable `#dart.library.io.allow_http` set to `true` or
`false`.
The default behavior in SDK is unchanged.
Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This gets rid of a slow AssertAssignable (function type test)
in _asyncThenWrapperHelper/_awaitHelper, which currently falls back to the slow table
search:
AssertAssignable
^--> TypeTestingStub
^--> SlowTypeTestStub
^--> Subtype6TestCacheStub
Issue https://github.com/dart-lang/sdk/issues/37668
Change-Id: I3b6517b7e348e39619e8096d6ac2a4b179bb3242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142022
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Since JavaScript constructor functions are not valid Dart functions,
they should not be expected to have a Function type.
For context see: https://github.com/dart-lang/sdk/issues/41259
Change-Id: I9092700ad60712f604cec7e5cf0189b23024839a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142321
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Bug: https://github.com/dart-lang/sdk/issues/41275
insertAll should be unimplemented. It was previously relying
on a call to ChildrenElementList.length in the List mixin to
throw an UnsupportedError.
Change-Id: Ie8e5b126ea75a538e9db8b939bff0be012814efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Pre-nnbd, add and toggle were allowed to return null, but with the
change in the Set interface, they must return a non-nullable bool.
Change-Id: I1dfcb43d8c816f46f847d22d6f62507c6a77e4a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141500
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
There are several instances where there are non-nullable
variables with null checks associated with them that should
be converted back to nullable. Attribute functions in Element
are clarified as well.
Change-Id: I23cf020f02f3d4b512e041f0339daafb46fdd7f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140909
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Defer evaluating 'fromEnvironment' values while building
dart2js_platform.dill.
Future step is to make it work for the Flutter (See https://github.com/flutter/flutter/issues/53284)
Change-Id: Ieef8739364c47540766201332769876cba9f0a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141467
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Type arguments cannot be generic functions, so we add specialized
classes for each generic function type we need to make ZoneFunctions for.
Fixes#41253.
BUG= http://dartbug.com/41253
Change-Id: Idf84f04576465ea9e5ea749ece4a7d843a037e46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141884
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
FFI trampolines are stored in the global object pool and not
reachable either via class or via the closure functions in the
object store.
Fixes https://github.com/dart-lang/sdk/issues/41261
Bug: https://github.com/dart-lang/sdk/issues/41052
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I3e1551dba80a2fd418946d7449467317463c2c61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141882
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
In particular, don't serialize a function if its code is used by the
dispatch table, but there's no need for the function object itself
at runtime like dynamic lookup or dynamic invocation forwarders.
However, just because the owning function is not needed at runtime,
it may be used during serialization for things like assembly label
creation. Thus, instead of just clearing out the Code's owner field,
we add a new WeakSerializationReference (WSR) object whose target is
the original contents of the owner field. The WSR allows the
serializer to access the original owner, but also signals to the
serializer that the target should not be serialized in AOT snapshots
unless there are additional strong (non-WSR) references.
If no strong references are found, then the references to the WSR
in the snapshot are replaced with a reference to a WSR that only
contains the class ID of the original target. The serializer creates
only one WSR per class ID.
If strong references are found, then the target is still serialized.
In this case, the WSR is dropped entirely and any reference to it is
replaced with a direct reference to the serialized target. Thus, WSRs
only exist in the precompiled runtime for targets with no strong
references.
Changes on the Flutter gallery in release mode:
arm7: total size -1.10%, isolate size -6.08%
arm8: total size -1.16%, isolate size -6.09%
Bug: https://github.com/dart-lang/sdk/issues/41052
Change-Id: I5b435ca71ef85f50fe3484789087471a91aa4fe2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137104
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
- '_as' is now specialized on first use, like '_is'.
- '_is' specialization on `T?` that uses `T._is`
- recognize legacy versions of simple type tests (e.g. is int*)
The T? specialization makes a 2x improvement on some of the ListCopy
benchmarks on 'spec-mode' dart2js because some iterators have a T?
check.
Change-Id: I434a43de9e1322b34c3a5e11199415a75b7ed2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140944
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
According to RFC 7231 4.3.6,
A client MUST ignore any "Content-Length" or "Transfer-Encoding" header
fields received in a successful response to CONNECT.
Bug: https://github.com/dart-lang/sdk/issues/37808
Change-Id: I776f54b93807b4b7f9d9c9b9139728fa0415942a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140564
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
`Too many HandleMessage events` errors were noticed again on Opal.
Updating `available` at the end of _NativeSocket::Read() potentially leads to another read event, if pipe is populated after nativeRead() finished.
Stop updating the `available`. The eventhanlder will wake up again in the near future to issue read events.
Bug: https://buganizer.corp.google.com/issues/150902962
Change-Id: I86e3618077e6726a2105b8bde202816c50a3d2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
- Avoid unnecessary type checks.
- Convert comment syntax to actual generic method syntax.
- Cleanup some type Strings from the JS foreign interface.
- Use var on LHS more consistently.
Performance optimizations can be seen in the ArrayLoop
benchmarks with the highest being ArrayLoop.pseudopoly.forEach
with a 34.15% improvement.
These changes also avoid a large performance regression when
we unfork and the array contains legacy or nullable types.
Change-Id: I88e21a7b0d36d9bb9ba1b0e8ba24326f2b2c8229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140760
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
A combination of `runZoned` and `runZonedGuarded` where only the latter allows an `onError` parameter,
and only that has a nullable return type.
Retains the `onError` parameter on `runZoned` for now because it's too breaking to remove it until packages have been migrated off of it.
It will be removed in a follow-up CL.
Change-Id: If0e86c8d14e13fa089c66f4af975aeacb2616cf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137302
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Related to DOM clobbering of previousSibling
Change-Id: Ib4ed1cdba4217c351804b0689a999b73713f79ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This makes these checks useful in situations where you don't want to spend
an extra statement, like `=>` bodies or initializer lists (including
forwarding generative constructors).
Change-Id: Ia55b8741a7c75af631db48ac70e64597d8f96c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135649
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Support Unix domain sockets communication on Linux, MacOS and Android.
Changes:
1. Add a field for InternetAddressType named unix.
2. Constructor of InternetAddress gains one more optional field: type. InternetAddress(String address, {InternetAddressType type});
3. Add another constructor to InternetAddress which taks raw address/path for ip/unix addresses as an argument. InternetAddress.fromRawAddress(Uint8List rawAddress, {InternetAddressType type});
The operation for unix domain sockets communication is basically the same as normal sockets except an InternetAddress with type unix should be passed.
Change-Id: I6a1135bbdd7f4e4fc745ccf8f95dec5272b6839b
Bug: https://github.com/dart-lang/sdk/issues/21403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125932
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Without this, this class might get tree-shaken by the AOT compiler
despite being in the object store (linked_hash_set_class).
Fixes https://github.com/dart-lang/sdk/issues/40083
Change-Id: I8b3025283182280428d482999f2e6598419ee07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139816
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Vulnerability problems in http.
1. Double Content-Length is allowed currently. Reject if Content-length has been written.
2. An int is use to record the size of chunk size(for chunked encoding). When int overflows, it represent a wrong number.
3. Content-Length and Transfer-Encoding header should not appear together.
4. Add a 8K size limit when parsing "method", "URI","Header field" and "Header value".
Bug: https://b.corp.google.com/issues/150476984, https://github.com/dart-lang/sdk/issues/25390
Change-Id: Id4a81093a86f090cd1047aff8817dcfec3aa3ec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138266
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
CastError is deprecated and _TypeError now implements CastError, so
it is possible to remove the distinction in generated code.
All checks now go via Rti._as(x) to some _asXXXX method.
Change-Id: I4ce6735b6c904bcbc366de92ed149716caf9ae81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139959
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
pingInterval api pages says, when pong is not received on time, the connection will be closed. But our implementation didn't follow the description.
Bug: https://github.com/dart-lang/sdk/issues/39469
Change-Id: Ic62b8ab0152997ac60b1b836d6a1587d9ce38131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138760
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
Remove all `_check()` calls as they are now identical to `as()`.
Fixes: #41008
Change-Id: I4e4dd1ff50840d3d1cbf0aae9b8cef0621016079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139490
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is a breaking change. https://github.com/dart-lang/sdk/issues/40709
This change makes the HeaderValue parsing more strict in two invalid
edge cases, supports parameters with null values as a feature, and fixes
toString() so it always produces tokens or quoted-strings valid per RFC
7230 3.2.6.
The empty parameter value without double quotes (which is not allowed by
the standards) is now parsed as the empty string rather than null. E.g.
HeaderValue.parse("v;a=").parameters now gives {"a": ""} rather than
{"a": null}.
Invalid inputs with unbalanced double quotes are now rejected. E.g.
HeaderValue.parse('v;a="b').parameters will now throw a HttpException
instead of giving {"a": "b"}.
The HeaderValue.toString() method now supports parameters with null
values by omitting the value. E.g.:
HeaderValue("v", {"a": null, "b": "c"}).toString()
now gives
v; a; b=c
This behavior can be used to implement some features in the Accept and
Sec-WebSocket-Extensions headers.
Likewise the empty value and values using characters outside of RFC 7230
3.2.6 tokens are now correctly implemented by double quoting such values
with escape sequences. E.g.:
HeaderValue("v",
{"a": "A", "b": "(B)", "c": "", "d": "ø", "e": "\\\""}).toString()
now gives
v;a=A;b="(B)";c="";d="ø";e="\\\""
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: Iafc790e03b6290232cac71fe14f995ce0f0b036b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136620
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
When performing protobuf-aware treeshaking, we may generate a kernel
file which will later be used in conjunction with a non-transformed
platform kernel. In this case signature shaking is unsafe.
The original revision is in patchset 1.
This reverts commit b59dad38df.
Change-Id: I1a85e42f245fcdbd821fa1f07b2e9966b8c2d958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139100
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This is a reland of bef363bfb7
Original change's description:
> Fail synchronously if null is passed as an error to async APIs.
>
> The first patchset is Lasse's original changes.
>
> Change-Id: Ic5f24bcfc0ef4e82edee68d61e015b095cb5916e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138605
> Reviewed-by: Leaf Petersen <leafp@google.com>
Change-Id: I142831dca5dc4ca266ded08d93cb427ad3fbde74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139683
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Providing `filterKey` will result in all timeline events associated with
the TimelineTask including a `filterKey` entry in their arguments map,
set to the value provided in the constructor. This will allow for a
consistent way for tooling to filter asynchronous timeline events.
Fixes https://github.com/dart-lang/sdk/issues/40861
Change-Id: I06d3f9c73f06c2ff0e495f1b6a57fcf357d625a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139312
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Technically almost no user of ddc should be able to reach this compile-time error if they are using webdev (it appears a couple users do invoke it directly, though). Project sass demonstrated that users of dart2js can notice this breaking change.
Given that we are bundling many breaking changes for null-safety on the next release, it seems like making imports to dart:mirrors a compile-time error is not strictly necessary at this time.
One idea is to change this to a compile-time error in our tools when users opt-in their libraries or when they enable strong null-safety mode.
Change-Id: I7f12657eba508e2d071dda60087a21475a303d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139494
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This is a breaking change. https://github.com/dart-lang/sdk/issues/40706
The dummy object returned if FileStat.stat() and FileStat.statSync()
fail now contains Unix epoch timestamps instead of null for the
accessed, changed, and modified getters.
These timestamps are always non-null if the API succeeds and the
timestamps are meaningless when the API fails and returns the
FileSystemEntityType.notFound type. This change makes the timestamps
always non-null, which avoids all legitimate accesses needing a needless
null check when Dart becomes null safe. This change is consistent with
the mode and size getters that are initialized to non-null dummy values
when the API fail.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: Iff6b34d04b60f4c9f4cf8d9dd0679f721d142ba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136585
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit bef363bfb7.
Reason for revert: Breaks google3 tests, see b/151204525.
Original change's description:
> Fail synchronously if null is passed as an error to async APIs.
>
> The first patchset is Lasse's original changes.
>
> Change-Id: Ic5f24bcfc0ef4e82edee68d61e015b095cb5916e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138605
> Reviewed-by: Leaf Petersen <leafp@google.com>
TBR=leafp@google.com,rnystrom@google.com
Change-Id: Ie17c35e9d23c70a7aecd1ef292962154cf6f007d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138925
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Previous change on _NativeSocket::Read has a consequence of increasing the number of Read().
This change is to make Read() to drain as many bytes as possible to prevent Read event being posted again. But the side effect is that every single read() will become slower.
Bug: https://b.corp.google.com/issues/150902962
Change-Id: I58cc1e39ae598e2f1584da22d07ad1db3106bd39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138909
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The first patchset is Lasse's original changes.
Change-Id: Ic5f24bcfc0ef4e82edee68d61e015b095cb5916e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138605
Reviewed-by: Leaf Petersen <leafp@google.com>
doesn't show these formatting changes as diffs.
Change-Id: I69ccbf4adabc66d88371cece785a2c1bce60f133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We need to relax vm/dart/causal_stacks/async_throws_stack_no_causal_test
Change-Id: I40c08d432afeac839ce4f49bbf48c3707b23ef7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138804
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Use a JavaScript Symbol() for Array rti property. This makes the
property non-enumerable, avoiding making the property visible via
JS-interop.
The code is feature-tested so that IE11 still works with an enumerable
String property.
Bug: 40535
Change-Id: Ic8b64dac5751989fe4b8d023b0626c3db04676c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137245
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This flag is unused and the behavior it enables was only useful along with
`dart:mirrors`.
- Remove the flag and the field on the options object.
- Prune code branches that are no longer reachable.
- Remove or inline some functions that became either empty or trivially small.
- Remove the manual check for a `dart:mirrors` import since this is handled by
the CFE now.
- Remove references to the flag in tests.
- Remove test files which only existed to enable the flag for other tests.
Change-Id: I21bf594271fb4eeb5b73fcbf07da736e9e8d1f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138018
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
This reverts commit 9983424a3c.
Reason for revert: Breaks vm/dart/causal_stacks/async_throws_stack_no_causal_test
Original change's description:
> [vm] Add type to _AsyncAwaitCompleter.start.
>
> Without the type, the call to the the parameter f() was being handled
> as a dynamic InstanceCall (smiable), so we had a megamorphic call to one
> of the Closure_XXXX_call methods (there are many copies of this method
> for different signatures) which in turn calls the closure.
>
> Now that the type is present, we do a direct ClosureCall to the target.
>
> This gives a measurable improvement to an important internal benchmark.
>
> Change-Id: Ia9429879f69257465a2537616d8f8595fb1eefa8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138520
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>
TBR=kustermann@google.com,sjindel@google.com
Change-Id: I2deeebc24d80a7f444f4f53c5c8959b747fd1b29
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138502
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Without the type, the call to the the parameter f() was being handled
as a dynamic InstanceCall (smiable), so we had a megamorphic call to one
of the Closure_XXXX_call methods (there are many copies of this method
for different signatures) which in turn calls the closure.
Now that the type is present, we do a direct ClosureCall to the target.
This gives a measurable improvement to an important internal benchmark.
Change-Id: Ia9429879f69257465a2537616d8f8595fb1eefa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138520
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Because we cache on instances of type objects, all "type"-ish constructs in DDC must be pre-initialized if we want to avoid any hasOwnProperty checks (which are slow).
1) We now consult legacy/nullable caches earlier when wrapping types, as the downstream logic can be much slower than a lookup.
2) We cache on nullble and legacy wrappers themselves as well as just the underlying object (formerly we cached on just the latter) for faster lookups.
3) We attach local caches upfront, maintaining monomorphicity during hot code paths.
This improves regressions for opt-out worst-case tests from (120 us -> 2100 us) to (120 us -> 500 us) and weak mode tests from (120 us -> 1100 us) to (120 us -> 330 us).
Change-Id: I98a26064404e746162ca3feb22b0993c3b39e63c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138330
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Static methods and constructors may receive unboxed parameters.
This change adds a bitmap to the RawFunction object indicating
which parameters are unboxed and their types. Also, the stack frame
bitmap was updated to include new bits for those parameters.
The ArgumentsDescriptor object was updated to store not only the number
of arguments, but also their size, since 32-bit platforms would use two
words for each int64 and double value.
In addition, static methods that return non-nullable integers
and doubles may return these values unboxed.
Dart AOT x64:
TypedData.Uint8ClampedListViewVarBench +11.73%
DeltaBlue +9.32%
Meteor (Intel Xeon) +4.64%
Flutter release android-armv8:
velocity_tracker_bench -2.32% (less is better)
flutter_gallery_readonlydata_size +0.18%
flutter_gallery_total_size +0.13%
flutter_gallery_instructions_size +0.12%
Issue https://github.com/dart-lang/sdk/issues/33549
Change-Id: I97e310f8f30213920af2333fbdedf193d03db5c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135313
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
getOwnPropertyDescriptor is significantly slower than hasOwnProperty, and we didn't seem to be using any behavior specific to the descriptor besides the value.
Change-Id: I3329177ee78a5ca823e554dd4f7b0bd26e1d5be0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138331
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
On 1/27/20, the nnbd specification changed weak and strong mode instance checks
to make them behave uniformly across legacy and opted-in libraries.
Therefore, it is not necessary anymore to propagate the library mode in
generated code to the runtime.
Change-Id: I42d3ddc6e9a921899aeac21be6374c7893a6d27c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138111
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
These changes are also being back ported into the existing SDK
with minimal differences that will be gone when we unfork the
dart:_runtime library. In the current back port:
* FutureOr<Null>? is normalized to Future<Null>* instead of
Future<Null>?.
* There is no runtime normalization of FutureOr<T?>?. This
should have no effect since nullable types can not yet
appear.
Fixes: #40611, #40720
Change-Id: Ib3ddffbf3778f0f571cf95f58b6142d3ee0bf59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Since we transitioned to natives for dart:html, manually written native
fields should be rewritten. Similarly, if there are fields in abstract
classes that represent interfaces, they should be converted. Fields in
abstract classes that are used in that class are left alone.
Change-Id: I924363639a4430b88b810b7348815bbc3f040e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137642
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
New analyzer errors are reported for dart:html around nullability.
Non-nullable fields are translated to native getters and setters if part
of a concrete class and normal getters and setters if abstract.
Change-Id: I2fd87803a08872b2a7eae4de0af704f184997c7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137481
Reviewed-by: Stephen Adams <sra@google.com>
This enables dynamic linking of the symbols in dart_native_api.h to work around the Windows linking issue and Dart embedders not exposing symbols.
Issue: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/40564
Change-Id: I6f797cc915b53ec63fa5953529f17c40e52a2aed
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136962
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Back-porting a breaking change for Null Safety to the existing SDK to
help front load any issues (we expect them to be minimal).
https://github.com/dart-lang/sdk/issues/40633
We are now allowing the type argument bounds in generic function
subtypes to differ if the bounds are mutual subtypes.
Change-Id: I2b093c08f772a1b866dbe1324b605e6143d3a0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137289
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
if NativeSocket.read() has not specified `len`, I will expect caller wants all bytes(this is not documented, correct me if I'm wrong).
Check the available bytes after read(), if there are leftover, issue another read(). This will eventually drain the pipe.
Bug: https://github.com/dart-lang/sdk/issues/40589
Change-Id: I3b0be9ef8258defd1f71f85b3154702401e0f31c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136322
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
This reverts commit 9ab51b8012.
Reason for revert: Test failure in google3; please see internal b/150195057.
Original change's description:
> [vm/tfa] Convert named and optional parameters to required parameters where possible.
>
> Flutter Gallery code size (total):
> ARM64: -2.31%
> ARM32: -2.38%
>
> Change-Id: Ide7764afb06bf6f8387015de612cd4798b301541
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135305
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=alexmarkov@google.com,sjindel@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib198c7cf265384c336d9db6776742db23fb4e999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137102
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
The formatting churn is from being prompted with the required `git cl format` command
Change-Id: Ic2582f720e30f5d9a35fad05709455dad1068ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136842
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
These should go through the `cast` operation to fail in strong and pass with warning in weak.
Change-Id: I1863b507835c0c9993357318b9e7038154e47151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136902
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
According to the `FileSystemEvent` api page, isDirectory should always be false for delete events.
Bug: https://github.com/dart-lang/sdk/issues/35032
Change-Id: Ic277aa366db09c016979350d7369e004f9a8a152
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136405
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This means that TypeError no longer inherits a spurious `message` member.
The message of a platform-thrown TypeError is still available as `toString()`.
Fixes#40317
Bug: http://dartbug.com/40317
Change-Id: I77312859ebae3f92c2e56aeea6283b075b71c8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136129
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
CSSStyleDeclaration.getPropertyValue returns a non-nullable string.
It will also return an empty string if the property is not found. Since
getPropertyValue returns the value of the native getPropertyValue, the
null check should be removed.
Change-Id: I9846553d3f9fcd68cbd15b9c39d2104cab594b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136413
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
These fixes allow "hello world" to run in NNBD strong mode on the VM.
Change-Id: I3c17b8e1b7ab64086d830298ef8f7601bf1acb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136706
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is a breaking change. https://github.com/dart-lang/sdk/issues/40483
The Process class will now throw a StateError if the process is detached
upon accessing the exitCode getter. It now also throws when not
connected to the child process's stdio upon accessing the stdin, stdout,
and stderr getters. Previously these getters would all return null.
The getters in question are meaningless for detached processes and there
is no reason to use them in that case. To provide a better experience
when Dart becomes null-safe, these getters are changed to throw and
never return null, which avoids all legitimate uses of the getters from
needing a null check that will never fail.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: I776e0dc8bcd517d70332c60dd8ab88db17746aa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134329
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Several method bodies did not return a value conditionally or at all.
Change-Id: I01ca87e2e0501597bacb49bcddd10668b59026b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135626
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Looks like this got mixed up due to a bad rebase/merge.
Change-Id: I566acf5a84755cb26fb7b3283a227196cce68d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136061
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501
HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.
This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.
The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.
Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: Ieb9f4061b27ed3bbc6d82e6a408c77d11abb037b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135357
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This prevents them from being called dynamically.
Moreover, it prevents asFunction from being called on a non-NativeFunction type argument, simplifying the amount of manual checks.
Note that this CL had to change the CFE and analzyer, and their tests (including mock_sdk) as well.
This can potentially be a breaking change, as the extension methods are only visible when `dart:ffi` is imported, while methods on objects are always visible.
Issue: https://github.com/dart-lang/sdk/issues/35903
Change-Id: I1e291f154228d5d9a34b21a022088bf493f6557d
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135463
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
- Format consistently with a header sentence.
- Use `JavaScript` over `JS`, and surround references to the `@JS()`
annotation with backticks.
- Drop the word "efficiently" since it isn't true of the more commonly
used API `jsify`.
- Add a note about preferring `@anonymous` interop classes over `jsify`
with a map.
- Remove mention of `JsObject` since this isn't what gets returned.
- Clarify that Dart objects can't be used from JavaScript, this is
mentioned at the library level but it worth repeating on `jsify`.
Change-Id: If7582db6440d96f20bb5b4e11bcc0ffe047d9d0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135525
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
1. Remove limitation of http response status code check. It used to be [100, 599]. Extends range to [0, 999] to allow users to use customized status code.
2. Rephrase some http exceptions to be more informative.
3. Possibly a bug in isHead setter, where it is only allowed to set to true.
Bug: https://github.com/dart-lang/sdk/issues/38898
Change-Id: I77d8d66eb8333dec1f53742821860b802f74f680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134763
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
There are some tests failed after switching to NNBD. This is supposed to fix HttpException: Connection closed while receiving data.
It reduced the number of failure from 300 to 70.
The root cause is that HttpHeaders write {Transfer-Encoding: chunked} into _header field once user set it to true. However, when user tried to flip the bit,
remove() function didn't remove the content. This leads to an additional property in header. Parser alarmed when parsing it.
This is inconsistency on how others handle chunked transfer encoding. Looking at add(), set() and remove() implementation, all of them will only set _chunkedTransferEncoding instead of actually touching _header.
Bug: https://github.com/dart-lang/sdk/issues/40534
Change-Id: I80d76f3a6da01022fdb8e755e0def8a630ca376a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135353
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Addresses discrepancies between IDL and template files for some
operations. There's probably more I'm missing since this was
from a cursory check through all the templates.
Change-Id: Id79710b343f4a5fe0b5529f64c341d4f63d69b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Cleanup special handling for annotations required by pageloader/mirrors
use case that is now fully unsupported.
Should not be submitted until the removal of the libraries has landed
in flutter web.
https://github.com/flutter/engine/compare/master...vsmenon:vsm-mirrors
Change-Id: I00dbdc8e185a9c3e0585d030f670c1d5a4c77395
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134889
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The null check in DateTime._withValue is needed to be backwards
compatible with legacy code which might still call DateTime
constructors with isUtc == null.
Fixes co19_2/LibTest/core/DateTime/DateTime.fromMillisecondsSinceEpoch_A02_t01
failing test after unforking SDK.
Change-Id: I5394a25d0c6a5be41cad984f98e1cf56f400106e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134869
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
It was migrated to null-safety by throwing, but that's an unnecessary breaking change.
Change-Id: I92c21d7518bf7c291b333b33a04eb4b21b7cc210
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134725
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Optionals were being ignored for some methods and for optionals that
have a default of Undefined or None, they should be marked nullable in
Dart syntax regardless of whether they are in the IDL.
Change-Id: Icc71300dc7d8e06fef640a5ca8d502b093c0580c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134765
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bug: b/149075352
Event.path should call composedPath if the result of the inline is
True. As it is, it only calls it if the result is null, which is
erroneous.
Change-Id: Idacc9ccddafc4374aca10de84265bf82cfbd0ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134887
Reviewed-by: Sigmund Cherem <sigmund@google.com>
A followup change will delete the patches that are no longer needed once
these changes have been "mirrored" :P to the libraries files in the
flutter repos.
Change-Id: I7d255838b97922198248b29311facd4956001e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134405
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
-Adds field for type nullability for IDL operations
-Adds field for conversions to reflect input and output type nullability
--based on implementation
-Corrects generic object types to include nullability
-Changes 'any' types to dynamics
-Adds nullability to types in various operations
-Converts finals and non-initialized non-nullable fields to getters and
setters
--TODO: convert these to native instead of JS inline
-Modifies nullability for annotations and removes annotations from
setters
Change-Id: Iab19830fd1d7f37b170a4da8672f922c3f9b0863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132967
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Mostly changes to the comment syntax, removing optional `new`, and using the
same kind of quotes on strings.
Change-Id: Ia6d7f38523312f67cfa30cd30cef994759d40ef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134480
Reviewed-by: Bob Nystrom <rnystrom@google.com>