Commit graph

9402 commits

Author SHA1 Message Date
Lasse Reichstein Holst Nielsen 084f9faf81 Move BytesBuilder class and implementation to dart:typed_data.
Change-Id: I3e66e61940a1060e4970427799e0d8ebdaebb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150523
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-07-15 15:09:14 +00:00
Kevin Moore 966078df3a Fix a number of outdated references to dartlang.org in doc comments
Eliminated several links to content that no longer exists

Change-Id: Icd7bf5796a061882ba384e39d78d5f8ff429696d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154362
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2020-07-15 01:11:03 +00:00
Srujan Gaddam 63a57a76ce [dart:html] Revert "[dart:html] Revert commits using MDN compatibility info"
This reverts commit f8ff12008e.

This CL is a revert of the initial revert and should be landed once
Flutter changes have been merged to handle the changes here.

Change-Id: I300a5efd776bf2a596743971f4e15ad62da77f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153368
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-14 23:18:43 +00:00
Konstantin Shcheglov 8608726100 Stop supporting 'target?.[index]' and QUESTION_PERIOD_OPEN_SQUARE_BRACKET.
Change-Id: Icac4f851fbb9f283ce28ba8753c1b2e27a99cff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-14 14:36:19 +00:00
Lasse Reichstein Holst Nielsen 5e31578877 Update ListMixin/ListBase documentation and insert for Null Safety.
Document that `add` must be implemented when using
`ListMixin` or `ListBase` with Null Safety.

Changes ListMixin.insert to not grow the list itself,
but instead rely on `add` to do that.
This means that a user of ListMixin/ListBase
*only* needs to implement `add`
to support growing a list with non-nullable elements
(which they do need to because of Null Safety).

Fixes #42496

Bug: http://dartbug.com/42496
Change-Id: I9476f3111330d7c7f1878f165e066f86d3108b87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152853
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-14 11:04:08 +00:00
Nicholas Shahan 9460ac3c8d [ddc] Copy more .dill files to packaged sdk
Adds the sound full and outline as well as a weak full dill.

The outlines are required when compiling user applications. The full
dills will be used to compile the sdk to JS by the build system.

Change-Id: I74b3f1c34dba5fcdea2dfad07c6bf1af9c1e3f13
Issue: https://github.com/dart-lang/sdk/issues/42253
Fixes: https://github.com/dart-lang/sdk/issues/42083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153701
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-14 00:09:29 +00:00
Nicholas Shahan 7478143e5f [ddc] Inline the sound null safety flag
Now that the sound null safety mode is a compile time flag
instead of a runtime flag there is no need to set the value in
the bootstrapping code before running main(). The sound and weak
versions of the sdk now have it already set.

Add compileTimeFlag() method that will inline the constant value
directly into the generated output.

Change-Id: I5b9243c47cffc421067ac820ef49342b9d0efff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154100
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-13 22:45:19 +00:00
Stephen Adams f997d62a6d [html] Better code for Element / _ChildrenElementList method
Two tricks let us compile this more efficiently:

    e.children.addAll(cs);

Normally, get$children is inlined, returning a _ChildrenElementList
wrapper, generating:

     new W._ChildrenElementList(e, e.children).addAll$1(0, cs);

The two tricks:

1. Split _ChildElementList.addAll into an 'unwrap' that then calls the
   logic in '_addAll'

2. Add information about the properties of e.children that allow it to
   be removed.

With these tricks, dart2js can optimize the code to this version that
avoids allocating a wrapper or accessing the 'children' property:

     W._ChildrenElementList__addAll(e, cs);

Change-Id: Ifdf533ac4f9790f09f87302e67304b5696097266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153904
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-07-13 20:33:19 +00:00
Jacob MacDonald 742692d877 update vm patch file for inspect api to have the correct type
Bug:https://github.com/dart-lang/sdk/issues/42676
Change-Id: I975925df39b35af1fe53698026d2a2e84077ddaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2020-07-13 18:33:19 +00:00
Erik Ernst fecc8163af Update Dartdoc of Function
The Dartdoc of the class `Function` claimed that any class with a
`call` method is a subtype of `Function`. That rule is highly obsolete,
and this PR removes it.

Change-Id: I56318f6c6d8a19007c2b6259bc7d84532cd44707
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154004
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-07-13 10:22:34 +00:00
Nicholas Shahan cf57f882ca [ddc] Change ! failure to a throw TypeError
Fixes test failures in language/unsorted/inv_cse_licm_test

Change-Id: If8df024d0128568e1f65463d4a82fa593b5a6a1d
Fixes: https://github.com/dart-lang/sdk/issues/42443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153481
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-10 17:42:55 +00:00
Alexander Markov bfd15821a7 [vm] Specialize List.generate factory constructor invocations
List.generate could return both growable and fixed-size lists.
This change specializes invocations of List.generate when value of
'growable' argument is known (constant or omitted), so it becomes
possible to infer actual type returned by the factory.

This becomes more important with null safety as List.generate is used
more often to initialize lists of non-nullable elements.

Migrated NNBD benchmarks in AOT mode on x64:
Sudoku +11%
DartMicroBenchMM.{Min,Max}Lib +11-13%
DartMicroBenchMM.{Min,Max}Code +19-27%
ForInGeneratedLoop +19%
ForEachLoop +85%
ForInLoop +64%
ForLoop +680%

This change also includes test for inferred types of various List
constructors.

Change-Id: I801231b0a70e3aa8fb14ec9fe749f1dd420b1b9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153388
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-08 18:29:25 +00:00
Clement Skau 219935a48f [VM] Adds Future.timeout stack unwinding support for --lazy-async-stacks.
Bug: https://github.com/dart-lang/sdk/issues/40815
Change-Id: I1603e1effe67b727d5dc47c0830b4758c764cf4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152328
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-08 06:50:40 +00:00
Nicholas Shahan b524f398c3 [ddc] Add option to run non-null asserts in weak mode
* Setting the nonNullAsserts flag in the bootstrapping logic will
  enable/disable failing when a null value is passed to a non-nullable
  method parameter when running with weak null safety.

* Move the --null-assertions from VM options to the shared options in
  the test and use it to set the flag in DDC the entry point.

* Configure other backends to ignore the flag.

Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-07 21:48:40 +00:00
Mayank Patke 5c99205769 [dart2js] Support required named parameters in weak NNBD function types.
We cannot simply discard the `required` modifier in weak mode function
types since function types that differ in the placement of `required`
cannot compare equal. Instead, we do that during subtype checks.

We continue to ignore `required` in the actual calling convention in
weak mode.

Change-Id: I7dbb28550095c635f65592f78e495e8e4e8d7026
Fixes: https://github.com/dart-lang/sdk/issues/42608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153386
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-07 21:00:40 +00:00
Nicholas Shahan 4140853675 [dart2js/ddc] Add null checks to with<X|Y|Z|W> methods
Fixes test failures in lib/typed_data/simd_type_null_params_weak_test.

It appears that these methods are intended to retain the null checks
and failures in weak mode based on the discussion in the migration
https://dart-review.googlesource.com/c/sdk/+/132341.

Change-Id: Ieeb1730059a57b2edf1b5d235cd7a4133d4844df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152909
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-06 22:06:42 +00:00
Johnni Winther 34f5c9d0b4 [cfe] Implement new async return rules
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169

Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-06 07:04:40 +00:00
Alexander Markov c5ea3e85a0 [vm/nnbd] Further specialize invocations of List.filled factory
If 'growable' argument of List.filled factory invocation is known at
compile time we can replace it with more specialized constructors
creating growable or fixed-size lists. This results in a more accurate
inferred type and more efficient code which uses the created list.

Fixes https://github.com/dart-lang/sdk/issues/42551

Change-Id: I427e1bdb8a0f2a83410a9533050d19cbca2d27d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153064
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-03 23:19:02 +00:00
Srujan Gaddam f8ff12008e [dart:html] Revert commits using MDN compatibility info
This reverts commits aff77e7e..e24f205d.

Due to a breakage in a Flutter roll, this CL stack needs to be
reverted. It should be reintroduced with changes to Flutter code to
compile with the changes in dart:html.

Breakage: https://github.com/flutter/engine/runs/828631927

Change-Id: I9c93c4eab823337d09d2e347015ad9ec402f2038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152910
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-07-02 01:33:18 +00:00
Sigmund Cherem a114b165e5 [web] Fix dart:mirrors and include it with the dart2js SDK so we ensure it doesn't break accidentally
Change-Id: I047136bb5d09680be38408de9581cf6931e516d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152406
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-01 23:31:04 +00:00
Sigmund Cherem b83d06e4f8 Fix order of async callback arguments
This was noticed when running the benchmarks/Calls/dart/Calls.dart with
sound-null-safety.

The only fix that was needed is to swap the argument order, but I also changed
to add the type promotion to make these errors stand out statically.

Change-Id: If47b04596d2da9d30961705fd858f2f2ba2b12c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153062
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-07-01 23:06:24 +00:00
Srujan Gaddam e24f205d16 [dart:html] Mark setters nullable if incompatible as well
Getter types need to be a subtype of the setter type, so if getters
are nullable due to incompatibility, the setter needs to be as well.
This change makes those changes, updates documentation, and modifies
a template and test file.

Change-Id: I2130538bb4005b3553eb7951af022c1c2ed59c1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152607
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 7349385185 [dart:html] Changes to template/src to handle compat data
Mostly null-assertions to make code compatible with compat
data changes.

Change-Id: I8f7c6c2421d6427851a44588978910deae8440bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 76d7739cf7 [dart:html] Add compatiblity to manually written native getters
Native getters in src/template files are modified to reflect the info
in the compatibility data.

Change-Id: I98f96737e21c7b4ce6bd17ea398e9806c61122b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152046
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 1d97a4a375 [dart:html] Handle method overrides for MDN
Native getters that are incompatible were marked as nullable even
though they may override methods that aren't nullable. This fixes
those conflicts for various HTML methods.

Change-Id: I7c2456d5d223d825428cedb847d20139b7d271c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152045
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam aff77e7ed7 [dart:html] Incorporate MDN compatibility data
Bug: https://github.com/dart-lang/sdk/issues/41905

Uses MDN information in the generator script to get a better idea
of which attributes are compatible and are not. mdnreader.py is
introduced to parse the data present in third_party.

Change-Id: I330ccf918cb42deb4c09ab97db5f3d2f0c432d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149800
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-01 22:06:34 +00:00
Jacob MacDonald b743d6cac6 add flutter_test to allowed experiments
Bug: https://github.com/dart-lang/sdk/issues/41538
Change-Id: I494fb4404c17e07c2df0d429570b12ebc072889b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153061
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-07-01 18:15:54 +00:00
Robert Nystrom bec128612c Add dart_internal to the null safety allowlist.
It always should have been there, but we just missed it.

Change-Id: Ie18203c96d065ac1bd58fba28d6dbcd657b18a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152987
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-07-01 02:52:57 +00:00
Srujan Gaddam ff8f128a76 [dart:html] Update console interface
Closes https://github.com/dart-lang/sdk/issues/42213

Adds nullability to Console, adds missing methods and cleans
cleans existing ones up, and removes a stale template. Most
modifications are derived from https://console.spec.whatwg.org/
and the rest are derived from the MDN.

Change-Id: I26a099b15e53a4748afb61c7532bdbf64d7c4d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151091
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-30 23:32:27 +00:00
Nate Bosch d64cf16cf2 Avoid throwing an exception for hasTerminal
See https://github.com/dart-lang/test/issues/1261

Throwing and immediately catching an exception has negative implications
for debugging and pausing on thrown exceptions. The exception is not
needed provided we duplicate a small bit of knowledge - that the
function to retrieve terminal size would return a non-list.

Change-Id: Ic92f7c0480d58963e857c699aa0251eedeb3e627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152922
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Zichang Guo <zichangguo@google.com>
2020-06-30 18:16:04 +00:00
Alexander Markov e6cbfd71f1 [vm/corelib/nnbd] Fix null check in _GrowableList.length=
We should verify that element type is nullable every time length is
increased, not only when capacity is increased.

Fixes https://github.com/dart-lang/sdk/issues/42502

Change-Id: Id91c702a99028634da8c2d41ae0ceac521af2cf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152900
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-30 17:14:14 +00:00
Nicholas Shahan 97ba0acc72 [ddc] Check for a Never bound before normalizing
Change-Id: I3d2ab592d3f6fb0bb7c89974501240de7d67c9b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152185
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-30 17:13:14 +00:00
Nicholas Shahan ee9dba1217 [ddc/dart2js] Add failure case when setting list length
NNBD spec states expanding the length of a list of non-nullable
elements should produce a runtime error.
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#core-library-changes

Add private method `_setLengthUnsafe()` as a replacement for the
existing length setter to call internally when it is known to
be safe that skips the checks.

This breaks the corelib/list_test but it needs to be rewritten
pending a decision regarding the `ListMixin` implementation.
See: https://github.com/dart-lang/sdk/issues/42496

Issue: https://github.com/dart-lang/sdk/issues/39777
Change-Id: I081451227b332b68bb75bf08f3268e360bae090c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152423
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-29 18:39:43 +00:00
Zichang Guo f4a00be96e Update Duration.toString() description
This is a reland of https://dart-review.googlesource.com/c/sdk/+/151163.
The reported problem is a mismatch between actual behavior and
description. The original cl tried to fix the bahavior but it broke many
external users. Given the fact that the old behavior has been widely
accepted and used, updating comments might be the correct thing to do.

This cl will update the description of toString() to be sync with its
behavior.

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I899a346647c268c2dd4e582f9a9f44a3d2286720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152060
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-29 18:23:13 +00:00
Lasse Reichstein Holst Nielsen 17d0ba55e8 Add Stream.multi constructor.
A generalized stream which provides a controller for each listener.
Can be used to implement both broadcast streams and single subscription streams,
as well as any stream behavior between the two.

Change-Id: I7a75f8736ca6bc91ce266e768db68536efd24dfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150936
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-06-29 14:04:53 +00:00
Vijay Menon a9bef090e8 Revert "[dartdevc] Clear all constant containers after a hot restart."
This reverts commit 2e50075597.

This appears to be triggering a problem in Flutter:
https://github.com/flutter/flutter/issues/60286

Change-Id: I53bf6e7e648f2f20ae9bc38327bad3760e171ab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152581
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-06-25 18:31:22 +00:00
David Morgan 6bdf55f31f Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit 65e3c9d3b1.

Reason for revert: package:logging, package:stack_trace and package:usage need to be migrated first.

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Changes from the original landing:
> 
>  - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
>  - The test harness is taught about 'service_2'
>  - Observatory's package is added to front end's opt-in list
>  - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots
> 
> The ported tests themselves are not changed.
> 
> Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I43b72f149d8d7e9fe06006cdd8593fed1726aa3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152004
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-23 08:06:00 +00:00
Ryan Macnak 65e3c9d3b1 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Changes from the original landing:

 - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
 - The test harness is taught about 'service_2'
 - Observatory's package is added to front end's opt-in list
 - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots

The ported tests themselves are not changed.

Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-23 02:12:46 +00:00
David Morgan 1d3fbbed7c Revert "Fix duration.toString() to conform the description"
This reverts commit 038e981f89.

Reason for revert: Breaks some tests; visible changes to some web UIs.

Original change's description:
> Fix duration.toString() to conform the description
> 
> Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
> But when `hours` is less than 10, toString() doesn't have the leading
> zero, which is "H:MM:SS.mmmmmm".
> 
> The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733
> 
> Bug: https://github.com/dart-lang/sdk/issues/41737
> Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,zichangguo@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I4d7ef5de9807e8e2b2a77c2171d1693b7527f671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151848
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-22 10:29:15 +00:00
Siva Annamalai d46a696957 Revert "Reland : [VM/Runtime] Cleanup package config initialization code"
This reverts commit 03777dba31.

Reason for revert: Failures in couple of bots

Original change's description:
> Reland : [VM/Runtime] Cleanup package config initialization code
> 
> - Use _Init function for initialization of package config
> - Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,
> 
>   DartUtils::SetupPackageConfig
> - Rename Loader::InitForSnapshot to Loader::Init
> - Remove _setPackagesConfig, _setWorkingDirectory from builtin library
> - Rename _setPackagesMap to _setPackagesConfig
> Change-Id: I1e4a25e79706d7764247c9fbfcc8e8ce3231343c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151633
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

TBR=aam@google.com,asiva@google.com

Change-Id: Ibea8c35fe310ac7708f00bb9ffd58715b6924cb5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151869
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-20 08:02:53 +00:00
asiva 03777dba31 Reland : [VM/Runtime] Cleanup package config initialization code
- Use _Init function for initialization of package config
- Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,

  DartUtils::SetupPackageConfig
- Rename Loader::InitForSnapshot to Loader::Init
- Remove _setPackagesConfig, _setWorkingDirectory from builtin library
- Rename _setPackagesMap to _setPackagesConfig
Change-Id: I1e4a25e79706d7764247c9fbfcc8e8ce3231343c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151633
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-20 05:50:49 +00:00
Nicholas Shahan 40b95458a5 [ddc] Normalize T to Never when T extends Never
In generic function types when a type parameter T's bound is Never in
the current environment T should be normalized to Never where it
appears in the function type signature.

For example when S is never in:

`T Function<T extends S>()` --> `Never Function<T extends Never>()`

Passes the new generic_function_type_object_normalization_test.

Change-Id: I6ce2328bc81cd0df7bbc69fd8e59a45f707e9318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150290
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-19 23:40:37 +00:00
Zichang Guo 34ab9f84ab [dart:io] HttpClientConnection is destroyed for "CONNECT" request
If "CONNECT" is used in HttpClientRequest, it is supposed to create a
tunnel and reuse the socket. The socket should remain open instead of
being closed.

Bug: https://github.com/dart-lang/sdk/issues/37808
Change-Id: Ic765bdc6fe4d3e21b3117e882b38e3abae15ceda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148684
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-06-19 23:18:07 +00:00
Zichang Guo 038e981f89 Fix duration.toString() to conform the description
Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
But when `hours` is less than 10, toString() doesn't have the leading
zero, which is "H:MM:SS.mmmmmm".

The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-19 22:52:30 +00:00
Stephen Adams 7425b3de51 [dart2js] Remove more dead code.
Change-Id: Iff5b3921f40981c8122d7720ce80a5f01731aa47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151883
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-19 21:20:07 +00:00
Zichang Guo 242ce279db [dart:io] Fix Content-Length header being accidentally dropped
If the Content-Length has been set by contentLength setter, manually
setting the header to the same value will lead to the header being
dropped, since _contentLength is not updated in set() method. The method
set() will erase the header and add back the header with new value. As
_contentLength is not updated, when it adds back the new header, it
looks at _contentLength (Which is not reset) and skips the addition (
_contentLength is the same as the new value, we had the header already).

Bug: https://github.com/dart-lang/sdk/issues/42369
Change-Id: I3fba7cc332bdff0ba56e602ac810fbaeb85d2606
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151427
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-06-19 20:42:07 +00:00
Mark Zhou 2e50075597 [dartdevc] Clear all constant containers after a hot restart.
Change-Id: I4b30c88ac4bf0be0c3487e4370b710bc4cfd63ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151808
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-06-19 18:29:23 +00:00
Stephen Adams acf41746f5 [dart2js] More old-rti cleanup
Change-Id: Ia1bb661a255a9e3ea48b79ff33532d0d66e8e80e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151803
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-19 17:49:33 +00:00
Alexander Markov ea50b03cbe [vm/nnbd] Fix incorrect non-nullable types in core libraries
VM calls certain functions from core libraries implicitly and in
certain cases such functions can take null as argument.
This change fixes parameters which were declared with non-nullable
types, but in fact they should take null.

These incorrectly declared parameters trigger non-null assertions in
weak mode.

Change-Id: Ia80fa28e437b25427f13f9e672a069fa722e966a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151784
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-19 16:58:53 +00:00
Stephen Adams 1596bf3cd4 [js_runtime] Remove js_rti.dart
Change-Id: Ie28cca1b3b869e3bba55bbbd6ac8071ce22fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-18 21:11:12 +00:00