Commit graph

81883 commits

Author SHA1 Message Date
Kevin Moore cb7c932f7b analyzer: use Object.hash functions, deprecate JenkinsSmiHash
Also bump min SDK for pkg:analyzer

Towards https://github.com/dart-lang/sdk/issues/27698

Change-Id: Ic32c839c02f18afd99fdb98eb382540aae7da88a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214126
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 19:11:24 +00:00
Konstantin Shcheglov 31922b8c57 Fix an invalid null check in InlineMethodRefactoring.
Saw it failing in the crash log.

Change-Id: I6cf715aeb6f41e405af58a00b69b8742fd7c5ed0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214182
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 17:53:10 +00:00
Ryan Macnak 9854a04210 [vm] Remove dead Thread::pending_functions_.
Cf. c9f5c3a79e.

TEST=build
Change-Id: I9edff8afaf277b03c4dfdcdbea9ba244dde577ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213740
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-09-22 17:16:36 +00:00
Ryan Macnak 306718fe1e [vm, compiler] Fix FFI callbacks on ARM64C.
HEAP_BITS must be initialized before any variant of LoadCompressed is used.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/47259
Change-Id: I01ebb4e6c2eee1e61e15c1d8cc2913d0db27c2bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214124
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-09-22 17:11:36 +00:00
Mayank Patke d992af7e9c [dart2js] Preserve "signatures" when lowering late variables.
When we lower an uninitialized static field to a cell, we gives the cell
a mangled name and create a getter/setter pair with the original field
name. The getter/setter simply call the appropriate members on the cell.

This means that other libraries, even ones that haven't been transformed
(e.g. during modular compilation) will still interoperate correctly,
since the transformed library still has the same external signature.

Change-Id: I88edcb71fa5cb910869b4266628a029ad358b77e
Fixes: https://github.com/dart-lang/sdk/issues/45854
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214064
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-22 16:55:26 +00:00
Konstantin Shcheglov 31a04e775d Remove the path from the file read exception message.
Change-Id: Ic43ce2132344fd64bdff31fd1105796cb6204847
Bug: https://buganizer.corp.google.com/issues/200468974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 16:53:07 +00:00
Konstantin Shcheglov dfd7d7b37a Deprecate NodeList<TypeName> getters and replace with NodeList<NamedType>.
Change-Id: I6a772a7bca75e9c2ab4b3612d51c04ea6114ed6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214130
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 16:25:56 +00:00
Johnni Winther 6c4b75237a [kernel] Rename isFieldFormal to isInitializingFormal
+ update ast-to-text, including previous renames of covariant

TEST=existing

Change-Id: Ia29847cba791096ccd9c6c383a1b633a6150cd94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214042
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
2021-09-22 15:56:07 +00:00
Paul Berry df6bb1f786 Fix duplicate test case.
It's clear from the comments that the first case was meant to test the
variable `v` (which has type `Object?`), and the second was meant to
test the variable `d` (which has type `dynamic`), but they
accidentally were both referring to `v`.

Change-Id: I1c36350689d20fa8d86c7d1c66918307f5fe2253
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214132
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-22 15:47:26 +00:00
Konstantin Shcheglov fdf5014697 Get the language version of BazelWorkspace from the dart/build_defs/bzl/language.bzl
Presubmit looks green.
https://fusion2.corp.google.com/presubmit/tap/398141496/OCL:398141496:BASE:398160873:1632289516597:2c6df414/targets

Change-Id: Ibe12b4d0709cd38be0307a6c211962dca7a69de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214075
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 15:17:47 +00:00
Konstantin Shcheglov 34f1bddb88 Replace TypeName with NamedType in AstTestFactory.
Change-Id: I9920d1a3394c179a066f8a8ab339284e682175ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214129
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 15:01:59 +00:00
Konstantin Shcheglov 3d0a6845e4 Rename TypeNameTracker to NamedTypeTracker.
Change-Id: I097f5267d0bbc172f68ec685d35d3cee09312fb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214128
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 14:54:16 +00:00
Konstantin Shcheglov e0518b47cf Rename TypeNameResolver to NamedTypeResolver.
Change-Id: Ifd26abf211be47b3e65482d038eceb966a686fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214127
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 14:53:57 +00:00
Lasse R.H. Nielsen 18f37dd8f3 Add extension name getter on Enum.
We use an extension getter instead of an instance getter because
it doesn't conflict with any potential existing or future enums
which want an element named `name`.
Keeping the namespace for enum elements open is a priority.
We currently only reserve `index` and `values`.

BUG: https://github.com/dart-lang/language/issues/1511

Fixes language issue #1511, which is a long-standing request,
and should replace a number of alternative implementations
which are based on parsing the `toString()`.


This version has two fields on the shared superclass, the index
and private name, and has a separate `toString` for each `enum` class
which hard-codes that enum's class name.

An earlier version had both `"name"` and `"ClassName.name"` as fields
to be able to reuse the same `toString` method on all enum classes,
but that cost too much for JS compiled code.
Even having just `ClassName.` as a field and then combining inside
`toString` requires more code to create the enum instances.
Instead this version hardcodes the `ClassName.` string once
in the `toString` method, which means each enum class has its own
toString (which can *potentially* be tree-shaken then.)

This still tree-shakes slightly worse than the previous implementation
where every enum class had its own `index` and `_name` fields
independent of each other, which could then be tree-shaken independently.
However, the `index` was already made an interface member with the
addition of the `Enum` interface, so code which accesses `.index`
on something of the `Enum` supertype could prevent tree-shaking of
all enum classes' `index` fields.
Likewise any general access to the "name" of an enum would necessarily
do the same for the name.
This CL makes up for some of that by sharing more implementation
between enum classes.

DartVM AOT CodeSize impact: ~0.15% regression on gallery (little less on big g3 app)

TEST= New tests added to enum_test.dart

Change-Id: Id25334e6c987f470f558de3c141d0e3ff542b020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-22 14:20:16 +00:00
Paul Berry 24c20d4844 Lock down FfiCode.type to ErrorType.COMPILE_TIME_ERROR.
Previously, the FfiCode constructor allowed the error type to be
overridden, but no use of that constructor actually took advantage of
it.

Hardcoding the type of all FFI error codes makes the implementation of
error codes more uniform, which helps pave the way for code
generation.

If in the future, we decide that we actually need some FFI error codes
to have different error types than others, we can always add the
functionality back in.

Change-Id: I5061281089aeba0185fd8ebaa08a82482e91f2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214070
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-22 12:31:26 +00:00
Chloe Stefantsova 684e8cf9f7 [cfe] Distinguish between call-site access kind in shown members
Change-Id: Ie893e1b9ef46ccfb3a86393cec4342845af49f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213765
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-09-22 10:13:37 +00:00
Alexander Thomas 63932dc7d3 [testing] Fix logic for detecting invalid named configurations
* Fix regression (https://dart-review.googlesource.com/c/sdk/+/214040).
* Add tests for invalid configurations with and without named configs.
* Add a custom test matrix for testing.

Change-Id: If169571c3163c5f4da1d3d989a2fcff6dc0a7d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214044
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-09-22 09:34:46 +00:00
Martin Kustermann 7e108dc53d [vm/concurrency] Add CHANGELOG.md entry for work on isolates
Issue https://github.com/dart-lang/sdk/issues/46754
Issue https://github.com/dart-lang/sdk/issues/36097

TEST=ci

Change-Id: Ic0b1ecf88790576ae1f31b6a003b2175b9af1c66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213343
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2021-09-22 08:39:35 +00:00
Konstantin Shcheglov 8aa9716d36 Replace TypeName with NamedType in nnbd_migration/, where possible.
Change-Id: I8031e1f7f0192e211598a806b3ba4244784b6b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:27:37 +00:00
Konstantin Shcheglov 8ecbaa8393 Replace TypeName with NamedType in analysis_server/, where possible.
Change-Id: Ice232aed2b705030861afa115350b1c77aa49d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:26:39 +00:00
Konstantin Shcheglov b8877d1f5a Replace TypeName with NamedType in analyzer_plugin/, where possible.
Change-Id: I979e904fc54fef6dfc42cb999ac72fefb669f462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:26:21 +00:00
Konstantin Shcheglov 6fc5d5956d Replace TypeName with NamedType in AstFactory.
Change-Id: If3ef21313321725728fa716c06462138e42435a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 01:26:11 +00:00
Konstantin Shcheglov 056a6cae31 Replace more references to TypeName with NamedType.
Change-Id: I6981aac2ca0d17bd3dd75c37689ef66319214cc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 00:34:30 +00:00
Ryan Macnak 2d207f49cc [vm, compiler] Adjust the write barrier stub to no longer assume there is no race when setting the remembered bit.
Failure to check for losing the race can result in the same object being added to the remembered set twice, and processing the remembered set is not idempotent.

Previously there could be no such race, but the combination of lazy initialized const maps/sets and isolate groups means that now more than one Dart thread can be writing to the same object.

TEST=cfe and fuzzer bots, flaky
Bug: https://github.com/dart-lang/sdk/issues/47233
Change-Id: I7684ea6ba90941bb174c35ae040372aa331ac4c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214077
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-09-22 00:16:58 +00:00
Riley Porter 82e8948ddc Add external extension fields, getters, and setters.
CFE transformation to add a function body for external fields,
getters, and setters, routing to the relevant js_util
getProperty and setProperty optimized calls.

Change-Id: Ia3d0f05fda50f20d217c0a67e0fd636bb774000b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213600
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-09-21 22:56:18 +00:00
Konstantin Shcheglov f5c114ad66 Remove AnalysisDriver.onCurrentSessionAboutToBeDiscarded
Change-Id: I283469662c5edab7ec1cf7f9ab37587cd4758211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 21:30:31 +00:00
Konstantin Shcheglov 8495d8b591 Rename FindNode.typeName() to namedType().
Change-Id: Idc0a2ef9cd5bddda345e9a7e603145c7d3ee2a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 21:30:28 +00:00
Konstantin Shcheglov b41ae230a2 Replace many casts to TypeName with NamedType.
Change-Id: I485b7a3e268c59c435f02e3357dc5dcf256e627e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214067
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 20:32:38 +00:00
Paul Berry 201ee847fe Migration: Properly handle awaits of custom future classes.
Bug: https://b.corp.google.com/issues/200651131
Change-Id: Ia06066783a9107848f85bc234b7612a55f54c9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214069
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-21 20:29:07 +00:00
Nicholas Shahan bc854d6642 [tests] Add nested function subtype test
Change-Id: I04368d00010e81148c608ba0d8f0371a516862e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213966
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-09-21 19:16:37 +00:00
Siva Annamalai a433fc3e13 Revert "[ VM ] Properly shutdown non-core system isolates when cleaning up the"
This reverts commit 58c58af3e8.

Reason for revert: The code can cause a deadlock, see https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8835779319093894049/+/u/vm_tests_shard_2/task_stdout_stderr:_vm_tests_shard_2

Original change's description:
> [ VM ] Properly shutdown non-core system isolates when cleaning up the
> VM
>
> Speculative fix for https://github.com/dart-lang/sdk/issues/45771
>
> TEST=CQ + vm/cc tests
>
> Change-Id: I3f05d78666ee78afca5af6047df96d7841cd1e02
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213561
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

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

Change-Id: I606d805e173b59dcb6651658a194a58d63afcc48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214065
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-09-21 18:52:58 +00:00
Nicholas Shahan a06466ff7d [ddc] Skip unsupported 64-bit int tests
Copies the same skipped tests from the dart2js status file.

Change-Id: I617f182a9fd64e1293b05bdbcbc61bfb2115bf99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213968
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-21 18:51:47 +00:00
Konstantin Shcheglov dc5eec2c5a Issue 46103. Resolve type arguments of TypeName(s) - there might be expressions.
Bug: https://github.com/dart-lang/sdk/issues/46103
Change-Id: Ia847403c7609f289f3f3f8bd5cd10e221216993f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 17:23:18 +00:00
Nate Bosch bcaa2a320c Add fixes for Remaining renames
Add fix definitions and tests for renamed class and top level constants in
`dart:developer` and `dart:io`.

Change-Id: I6851bd61c68fdcff461117fe8f2ab1c3890cb9df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214000
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-09-21 16:07:30 +00:00
Konstantin Shcheglov 9220ce35cb Fix cases where TypeImpl.toString() is used.
Instead getDisplayString() should be used.

Change-Id: I1c988bc9d193398aadbb32620e01f11ea3e353d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213900
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 15:16:22 +00:00
Konstantin Shcheglov 0c893bfd7f Rename assertTypeName() to assertNamedType().
Change-Id: I959da4662efccdb1d89fbf13eb23220439e6dd34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213980
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 15:00:22 +00:00
Stephen Adams 5c719b3bd3 [dart2js] Simplify message templates
Change-Id: I8e3f33664a3e7944e1b2d6bcf09bebd74c7b826e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214003
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-21 12:45:02 +00:00
Alexander Thomas b3cfd293ad [infra] Allow arm64c on Android configurations
* Fail test.py if an invalid named configuration is used.

Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm64c-try
Change-Id: Ib700511a639ee39fd58441dd6fee8bd6dad8c2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214040
Reviewed-by: William Hesse <whesse@google.com>
2021-09-21 10:15:29 +00:00
Stephen Adams 0071b38172 [dart2js] dart format --fix in kernel/
Change-Id: Iab8c98930c6add208679074c562f129e797af780
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213970
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-21 02:01:08 +00:00
Mayank Patke 35421c5d1a [dart2js] Update MethodTypeInformation to narrow the return type of
_lateReadCheck.

Change-Id: If76a5b34cfd9da9721bfa0d8642b018a4af131dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213901
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-21 01:59:45 +00:00
Stephen Adams 9872fd192e [dart2js] Modernize allocations in js_emitter/
Change-Id: Iecdde5c8940ede24f4ac428a624984a0b2ca4f97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213963
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-09-21 01:05:15 +00:00
Stephen Adams 048dd185c6 [dart2js] Modernize allocations in js_model/
Change-Id: If93776e2f556e8d7adfdbe5e3603f7477e0486f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213902
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-21 00:22:55 +00:00
Nicholas Shahan 85a12eac55 [ddc] Fix missing type variable bounds subtype check
When testing the subtype relation between two generic function types,
uninstantiated type variables can appear as an argument or return type
of one function while a concrete type appears in corresponding
position of the other function. A subtype relation can be established
if the bound of the type variable is a subtype of the concrete type.
For example given a type variable T with bound B and a concrete type
C we can say:

T <: C when T <: B <: C holds.

T <: B is true by the definition of interface subtypes `T extends B`.
This change adds a test for B <: C.

Add a new class used only when it appears we may need to test these
subtype relations. The class is used to plumb the bound information
of type variables further into the subtype check algorithm where it
is now tested.

Add a top level variable to index the total number of type arguments
seen during a subtype check through nested function types.

Change-Id: If6aa13e7b758f7fedcb5dbd8e09d366082198e61
Fixes: https://github.com/dart-lang/sdk/issues/38816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213527
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-09-20 23:29:45 +00:00
Nicholas Shahan e8cd9f0c44 [ddc] Refactor _isInterfaceSubtype
Move the method body out of one giant JS foreign function and into
Dart code with small JS foreign function calls inside.

* Removes the confusion around what it actually means when we use
  Dart String interpolation within the JS function template.
* Highlights the operations that actually need the JS foreign
  function.
* Allows for syntax highlighting and automatic formatting of this
  code.
* Allows for IDE "jump to definition" for class members that were
  previously inside the template.

These changes were developed by diffing the compiled output to
ensure the changes were as minimal and inconsequential as possible.
Intentional diffs include:
* Add a required message argument to `dart.assertFailed()`.
* Add local variables for `varianceType`, `typeArg1`, and
  `typeArg2`.

The only other diff was the loop variable incrementing:
`++i` -> `i = i + 1`

Change-Id: I76a1522fa4950f05748f905e1aec32c8b7dd4670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213526
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-09-20 23:06:55 +00:00
Alexander Aprelev d46f474d79 [dartfuzz] Fix time units in 'Isolate busy' message
Change-Id: I3d14763a2607ef47a51883a2acaf7545e63358ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213964
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-20 22:04:15 +00:00
Janice Collins 524a72a28a Update dartdoc version to 3.1.0.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v3.1.0

Change-Id: I7b08ea2ad84b478c62723ecbb4aef788d36f9f35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213962
Auto-Submit: Janice Collins <jcollins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 21:49:25 +00:00
Konstantin Shcheglov 064a7cca5f Tweak the type check and remove a cast.
Change-Id: I4524e0a52300854a88bb89067e6c9c604308a118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 21:36:29 +00:00
Nicholas Shahan cf7d46097b [ddc] Refactor _isSubtype
Move the method body out of one giant JS foreign function and into
Dart code with small JS foreign function calls inside.

* Removes the confusion around what it actually means when we use
  Dart String interpolation within the JS function template.
* Highlights the operations that actually need the JS foreign
  function.
* Allows for syntax highlighting and automatic formatting of this
  code.
* Allows for IDE "jump to definition" for class members that were
  previously inside the template.

These changes were developed by diffing the compiled output to
ensure the changes were as minimal and inconsequential as possible.
The only diffs that appeared beyond the intentional addition of
the `t1Bound` and `t2Bound` local variables were:

* Using the top level variable for a type:
  `dart.nullable(core.Object)` -> `T$.ObjectN()`
* Loop variable incrementing:
  `i++` -> `i = i + 1`

Change-Id: I55fa3fa94b984c67b18a744837843d458231c4d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213525
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-20 21:28:29 +00:00
Stephen Adams a666e5a221 [dart2js] dart format --fix in serialization/
Change-Id: I0e14a6fad41721380fbd406104932c7a8011e4ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213960
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 21:28:26 +00:00
Sam Rawlins f12333dfa0 Resolve more cases of .call; correct many cases of PropertyAccess receivers
Fixes https://github.com/dart-lang/sdk/issues/47211

Much of this change is about decision-making based on the _type_ of the
function in a FunctionReference, or the receiver of that function, in the
case of prefixed identifiers or property access.

Previously, there was a rule that only direct references to functions
(top-level, local, and method) could be torn off and type-instantiated.
That rule has been reversed (#1812), so a lot of unraveling has to be
done here.

`e.call<...>` is now legal for _any_ generic function-typed expression
`e`, which certainly may be an expression without a staticElement.
Additionally, `e<...>` is now legal for _any_ generic function-typed
expression `e`.

Because we no longer resolve PropertyAccess piecemeal, we no longer
report UNDEFINED_IDENTIFIER or UNDEFINED_PREFIXED_ELEMENT etc before
deciding to check if a tearoff is being made on a function-typed
element. The unfortunate side-effect here is some redundant
error-reporting. :( I've left TODOs.

Change-Id: I62106332e39d528cbd7cdfa5ec831dc56b394b52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 20:17:35 +00:00