master branch to main

Fixes #47190

TEST=None, only markdown files where edited.

Change-Id: Ife204f9c792b6bce30d0cd7bf2260ced11c8f2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
Ahmed Ashour 2021-09-15 06:22:23 +00:00 committed by Alexander Thomas
parent 17503caa05
commit d6975c1905
29 changed files with 60 additions and 60 deletions

View file

@ -2168,7 +2168,7 @@ failing. This changes makes DDC behave more like dart2js with the default flags.
throws in dart2js if the API is used directly without manually setting up a
`defaultPackagesBase` hook.
[1]: https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#200---2018-08-07
[1]: https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md#200---2018-08-07
#### `dart:developer`
@ -3783,7 +3783,7 @@ Still need entries for all changes to dart:web_audio,web_gl,web_sql since 1.x
- Dart `int` is now restricted to 64 bits. On overflow, arithmetic operations
wrap around, and integer literals larger than 64 bits are not allowed. See
https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md
https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md
for details.
- The Dart VM no longer attempts to perform `packages/` directory resolution

View file

@ -26,7 +26,7 @@ We occasionally take pull requests, e.g., for comment changes, but the main flow
## Getting the code
To work with the Dart code, you need to download and build the development branch. Active development of Dart takes place on the `master` branch, from which we push "green" versions that have passed all tests to `dev` branch. Complete instructions are found at [Getting The Source](https://github.com/dart-lang/sdk/wiki/Building#getting-the-source)
To work with the Dart code, you need to download and build the development branch. Active development of Dart takes place on the `main` branch, from which we push "green" versions that have passed all tests to `dev` branch. Complete instructions are found at [Getting The Source](https://github.com/dart-lang/sdk/wiki/Building#getting-the-source)
## Starting a patch with git
@ -56,7 +56,7 @@ git rebase-update
Note: you can run this command from any branch.
This command will fetch
origin/main, rebase all your open branches, and delete
`origin/main`, rebase all your open branches, and delete
cleanly merged branches.
Your local workflow may vary.

View file

@ -80,7 +80,7 @@ type checking, and some run-time errors cannot occur.
However, covariant parameter types can be quite natural and convenient,
they just impose an obligation on developers to use ad-hoc reasoning in
order to avoid the potential type errors at run time. The
[covariant overrides](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/covariant-overrides.md)
[covariant overrides](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/covariant-overrides.md)
feature was added exactly for this purpose: When developers want to use
unsound covariance, they can get it by requesting it explicitly. In the
(vast majority of) cases where the sound and more strict contravariant rule
@ -252,7 +252,7 @@ torn-off methods will indeed change with the introduction of this feature.*
When we say that a parameter is **covariant by modifier**, we are referring
to the definition of being a covariant parameter which is given in
[covariant overrides](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/covariant-overrides.md).
[covariant overrides](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/covariant-overrides.md).
*When a parameter _p_ is covariant by modifier, there will necessarily be a
declaration of a formal parameter _p1_ (which may be the same as _p_, or it

View file

@ -37,7 +37,7 @@ This document draws on many of the comments on the SDK issue
## Motivation
The
[language specification](https://github.com/dart-lang/sdk/blob/master/docs/language/dartLangSpec.tex)
[language specification](https://github.com/dart-lang/sdk/blob/main/docs/language/dartLangSpec.tex)
uses the phrase _function object_ to denote the first-class semantic
entity which corresponds to a function declaration. In the following
example, each of the expressions `fg`, `A.fs`, `new A().fi`, and `fl` in

View file

@ -11,7 +11,7 @@ feature. **The feature** adds support for omitting some occurrences of the
reserved words `new` and `const` in instance creation expressions.
This feature specification was written with a
[combined proposal](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md)
[combined proposal](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new-const.md)
as the starting point. That proposal presents optional new and optional const
together with several other features.
@ -303,5 +303,5 @@ eliminated by the code transformation.
- 0.1 (2017-08-15) Stand-alone informal specification for optional new created,
using version 0.8 of the combined proposal
[optional-new-const.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md)
[optional-new-const.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new-const.md)
as the starting point.

View file

@ -275,7 +275,7 @@ the current bounds is strictly decreasing with each step, and we terminate
when that number reaches zero.*
*Note that this process may produce a
[super-bounded type](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md).*
[super-bounded type](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md).*
*It may seem somewhat arbitrary to treat unused and invariant parameters
the same as covariant parameters. In particular, we could easily have made
@ -386,7 +386,7 @@ applicable.
there.
* Sep 15th 2017: Transferred to the SDK repository as
[instantiate-to-bound.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
[instantiate-to-bound.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).
* Sep 15th 2017: Adjusted to include the enhanced expressive power
described in

View file

@ -79,7 +79,7 @@ differently.
This means that we will express the complete rules for being 'more
interface-specific than' as a slight modification of
[subtyping.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/subtyping.md)
[subtyping.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/subtyping.md)
and in particular, the rule 'Right Top' will need to be split in cases
such that `Object` and `dynamic` are more interface-specific than `void` and
mutually unrelated, and all other types are more interface-specific than
@ -109,7 +109,7 @@ This compile-time error also arises if the type arguments are not given
explicitly.
*They might be obtained via
[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md)
[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md)
or, in case such a mechanism is introduced, they might be inferred.*
*The language specification already contains verbiage to this effect, but we

View file

@ -5,7 +5,7 @@
**Version**: 0.8 (2017-06-20)
**Status**: This is background material for
[implicit-creation.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/implicit-creation.md).
[implicit-creation.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/implicit-creation.md).
This informal specification documents a group of four related features.
* Optional `const`

View file

@ -108,7 +108,7 @@ But that's exactly what we _must_ find, if we are to safely express the
greatest possible amount of information about the set of objects whose type
is on the form `C<T>` for some `T`. In particular, we cannot express the
type which "should be" the result of
[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md)
[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md)
on the raw type `C`.
We can make an attempt to approximate the least supertype of all correct

View file

@ -284,7 +284,7 @@ use `?` and `late` in their library today.
That's it. Now you have a library that Dart tools know targets 2.8+non-nullable,
at least today.
[experimental flags doc]: https://github.com/dart-lang/sdk/blob/master/docs/process/experimental-flags.md
[experimental flags doc]: https://github.com/dart-lang/sdk/blob/main/docs/process/experimental-flags.md
### 2.8.0 ships without null safety

View file

@ -963,7 +963,7 @@ void myMagicTest(String name, FutureOr Function() body) {
test(name, body);
}
```
When subscribed to [notifications for outlines of a test file](https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html#notification_analysis.outline),
When subscribed to [notifications for outlines of a test file](https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/doc/api.html#notification_analysis.outline),
they will include elements for UNIT_TEST_GROUP and UNIT_TEST_TEST.
* Improve guess for type name identifier. (#32765)
* Fix LineInfo.getOffsetOfLineAfter().

View file

@ -28,7 +28,7 @@ Questions and discussions are welcome at the
See the [LICENSE] file.
[issues]: https://github.com/dart-lang/sdk/issues
[LICENSE]: https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/LICENSE
[LICENSE]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/LICENSE
[list]: https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss
[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/api.html
[tutorial]: https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/tutorial/tutorial.md
[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/api.html
[tutorial]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/tutorial/tutorial.md

View file

@ -215,4 +215,4 @@ There is a tutorial explaining how to implement [assists][assists].
[completion]: completion.md
[fixes]: fixes.md
[navigation]: navigation.md
[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/api.html
[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/api.html

View file

@ -33,4 +33,4 @@ void main() {
```
[dds-protocol]: dds_protocol.md
[service-protocol]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md
[service-protocol]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md

View file

@ -282,17 +282,17 @@ version | comments
1.2 | Added `getStreamHistory` RPC.
1.3 | Added `getAvailableCachedCpuSamples` and `getCachedCpuSamples` RPCs.
[resume]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#resume
[success]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#success
[version]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#version
[cpu-samples]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#cpusamples
[resume]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#resume
[success]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#success
[version]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#version
[cpu-samples]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#cpusamples
[service-protocol]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md
[service-protocol-rpcs-requests-and-responses]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#rpcs-requests-and-responses
[service-protocol-events]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#events
[service-protocol-streams]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#streamlisten
[service-protocol-binary-events]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#binary-events
[service-protocol-types]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#types
[service-protocol-ids-and-names]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#ids-and-names
[service-protocol-public-rpcs]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#public-rpcs
[service-protocol-public-types]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#public-types
[service-protocol]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md
[service-protocol-rpcs-requests-and-responses]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#rpcs-requests-and-responses
[service-protocol-events]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#events
[service-protocol-streams]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#streamlisten
[service-protocol-binary-events]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#binary-events
[service-protocol-types]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#types
[service-protocol-ids-and-names]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#ids-and-names
[service-protocol-public-rpcs]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#public-rpcs
[service-protocol-public-types]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#public-types

View file

@ -370,7 +370,7 @@ restrictions on Dart programs.
Strong mode effectively treats all standard Dart static warnings as static errors. Most of these warnings are required for soundness (e.g., if a concrete class is missing methods required by a declared interface). A full list of Dart static warnings may found in the [Dart specification][dartspec], or enumerated here:
[https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/generated/error.dart#L3772](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fdart-lang%2Fsdk%2Fblob%2Fmaster%2Fpkg%2Fanalyzer%2Flib%2Fsrc%2Fgenerated%2Ferror.dart%23L3772&sa=D&sntz=1&usg=AFQjCNFc4E37M1PshVcw4zk7C9jXgqfGbw)
[https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/lib/src/generated/error.dart#L3772](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fdart-lang%2Fsdk%2Fblob%2Fmaster%2Fpkg%2Fanalyzer%2Flib%2Fsrc%2Fgenerated%2Ferror.dart%23L3772&sa=D&sntz=1&usg=AFQjCNFc4E37M1PshVcw4zk7C9jXgqfGbw)
### Super Invocations

View file

@ -11,4 +11,4 @@ Post issues and feature requests at https://github.com/dart-lang/sdk/issues
See the [LICENSE] file.
[LICENSE]: https://github.com/dart-lang/sdk/blob/master/pkg/diagnostic/LICENSE
[LICENSE]: https://github.com/dart-lang/sdk/blob/main/pkg/diagnostic/LICENSE

View file

@ -7,11 +7,11 @@ A library to access the VM Service Protocol.
## Usage
See the
[example](https://github.com/dart-lang/sdk/blob/master/pkg/vm_service/example/vm_service_tester.dart)
[example](https://github.com/dart-lang/sdk/blob/main/pkg/vm_service/example/vm_service_tester.dart)
for a simple use of the library's API.
The VM Service Protocol spec can be found at
[github.com/dart-lang/sdk/runtime/vm/service/service.md](https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md).
[github.com/dart-lang/sdk/runtime/vm/service/service.md](https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md).
## Features and bugs

View file

@ -1,6 +1,6 @@
# Garbage Collection
The Dart VM has a generational garbage collector with two generations. The new generation is collected by a parallel, stop-the-world semispace [scavenger](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/scavenger.h). The old generation is collected by concurrent-[mark](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/marker.h)-concurrent-[sweep](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/sweeper.h) or by concurrent-mark-parallel-[compact](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/compactor.h).
The Dart VM has a generational garbage collector with two generations. The new generation is collected by a parallel, stop-the-world semispace [scavenger](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/scavenger.h). The old generation is collected by concurrent-[mark](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/marker.h)-concurrent-[sweep](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/sweeper.h) or by concurrent-mark-parallel-[compact](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/compactor.h).
## Object representation
@ -37,7 +37,7 @@ The VM does not know which stack slots, globals or object fields in foreign lang
Any non-GC thread or task that can allocate, read or write to the heap is called a "mutator" (because it can mutate the object graph).
Some phases of GC require that the heap is not being used by a mutator; we call these "[safepoint](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/safepoint.h) operations". Examples of safepoint operations include marking roots at the beginning of concurrent marking and the entirety of a scavenge.
Some phases of GC require that the heap is not being used by a mutator; we call these "[safepoint](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/safepoint.h) operations". Examples of safepoint operations include marking roots at the beginning of concurrent marking and the entirety of a scavenge.
To perform these operations, all mutators need to temporarily stop accessing the heap; we say that these mutators have reached a "safepoint". A mutator that has reached a safepoint will not resume accessing the heap (leave the safepoint) until the safepoint operation is complete. In addition to not accessing the heap, a mutator at a safepoint must not hold any pointers into the heap unless these pointers can be visited by the GC. For code in the VM runtime, this last property means holding only handles and no ObjectPtr nor UntaggedObject. Examples of places that might enter a safepoint include allocations, stack overflow checks, and transitions between compiled code and the runtime and native code.
@ -59,7 +59,7 @@ All objects have a bit in their header called the mark bit. At the start of a co
During the marking phase, the collector visits each of the root pointers. If the target object is an old-space object and its mark bit is clear, the mark bit is set and the target added to the marking stack (grey set). The collector then removes and visits objects in the marking stack, marking more old-space objects and adding them to the marking stack, until the marking stack is empty. At this point, all reachable objects have their mark bits set and all unreachable objects have their mark bits clear.
During the sweeping phase, the collector visits each old-space object. If the mark bit is clear, the object's memory is added to a [free list](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/freelist.h) to be used for future allocations. Otherwise the object's mark bit is cleared. If every object on some page is unreachable, the page is released to the OS.
During the sweeping phase, the collector visits each old-space object. If the mark bit is clear, the object's memory is added to a [free list](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/freelist.h) to be used for future allocations. Otherwise the object's mark bit is cleared. If every object on some page is unreachable, the page is released to the OS.
### New-Space as Roots

View file

@ -376,7 +376,7 @@ Finally if the number of checks in the linear array grows past threshold the cal
![AOT IC: dictionary](images/aot-ic-dictionary.png)
[what-is-kernel]: https://github.com/dart-lang/sdk/blob/master/pkg/kernel/README.md
[what-is-kernel]: https://github.com/dart-lang/sdk/blob/main/pkg/kernel/README.md
[pkg-front_end]: https://github.com/dart-lang/sdk/tree/master/pkg/front_end
## Runtime System

View file

@ -1,6 +1,6 @@
# Representation of Types
The Dart VM keeps track of the runtime type of Dart objects (also called *instances*) allocated in the heap by storing information in the objects themselves. Heap objects contain a header and zero or more fields that can point to further objects. Small integer objects (*Smi*) are not allocated as separate instances in the heap, but appear as immediate fields of instances. They are identified by their least significant bit being zero, as opposed to tagged object pointers whose least significant bit is one. Refer to the document [gc.md](https://github.com/dart-lang/sdk/blob/master/runtime/docs/gc.md) for a description of objects and tagged object pointers.
The Dart VM keeps track of the runtime type of Dart objects (also called *instances*) allocated in the heap by storing information in the objects themselves. Heap objects contain a header and zero or more fields that can point to further objects. Small integer objects (*Smi*) are not allocated as separate instances in the heap, but appear as immediate fields of instances. They are identified by their least significant bit being zero, as opposed to tagged object pointers whose least significant bit is one. Refer to the document [gc.md](https://github.com/dart-lang/sdk/blob/main/runtime/docs/gc.md) for a description of objects and tagged object pointers.
## Runtime Type of an Instance
@ -27,7 +27,7 @@ A parameter type in the signature can be either a `Type`, a `FunctionType`, or a
## AbstractType
The VM declares the class `AbstractType` as a placeholder to store a concrete type. The following classes extend `AbstractType`: `Type`, `FunctionType`, `TypeParameter`, and `TypeRef`. The latter one, `TypeRef` is used to break cycles in recursive type graphs. More on it later. `AbstractType` declares several virtual methods that may be overridden by concrete types. See its declaration in [object.h](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.h).
The VM declares the class `AbstractType` as a placeholder to store a concrete type. The following classes extend `AbstractType`: `Type`, `FunctionType`, `TypeParameter`, and `TypeRef`. The latter one, `TypeRef` is used to break cycles in recursive type graphs. More on it later. `AbstractType` declares several virtual methods that may be overridden by concrete types. See its declaration in [object.h](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.h).
## TypeArguments
@ -145,7 +145,7 @@ D<D<T>>: D[D<D<D<T>>>, D<T>]
D<D<D<T>>>: D[D<D<D<D<T>>>>, D<D<T>>]
...
```
The representation is divergent and therefore not possible. The VM detects non-contractive types (search for `ClassFinalizer::CheckRecursiveType` in the [class finalizer](https://github.com/dart-lang/sdk/blob/master/runtime/vm/class_finalizer.cc)) and reports an error. These non-contractive types make no sense in real programs and rejecting them is not an issue at all.
The representation is divergent and therefore not possible. The VM detects non-contractive types (search for `ClassFinalizer::CheckRecursiveType` in the [class finalizer](https://github.com/dart-lang/sdk/blob/main/runtime/vm/class_finalizer.cc)) and reports an error. These non-contractive types make no sense in real programs and rejecting them is not an issue at all.
## Compile Time Type
@ -216,7 +216,7 @@ Instead of implementing three different traversals, the kind of type equality is
## Finalization
Types read from kernel files (produced by the Common Front End) need finalization before being used in the VM runtime. Finalization consists in flattening type argument vectors and in assigning indices to type parameters. A generic type provided by CFE will always have as many type arguments as the number of type parameters declared by the types class. As explained above, type arguments get prepended to the type argument vector, so that the vector can be used unchanged in any super class of the types class. This is done by methods of the [class finalizer](https://github.com/dart-lang/sdk/blob/master/runtime/vm/class_finalizer.h) called `ExpandAndFinalizeTypeArguments` and `FillAndFinalizeTypeArguments`.
Types read from kernel files (produced by the Common Front End) need finalization before being used in the VM runtime. Finalization consists in flattening type argument vectors and in assigning indices to type parameters. A generic type provided by CFE will always have as many type arguments as the number of type parameters declared by the types class. As explained above, type arguments get prepended to the type argument vector, so that the vector can be used unchanged in any super class of the types class. This is done by methods of the [class finalizer](https://github.com/dart-lang/sdk/blob/main/runtime/vm/class_finalizer.h) called `ExpandAndFinalizeTypeArguments` and `FillAndFinalizeTypeArguments`.
The index of function type parameters can be assigned immediately upon loading of the type parameter from the kernel file. This is possible because enclosing generic functions are always loaded prior to inner generic functions. Therefore the number of type parameters declared in the enclosing scope is known. The picture is more complicated with class type parameters. Classes can reference each other and a clear order is not defined in the kernel file. Clusters of classes must be fully loaded before type arguments can be flattened, which in turn determines the indices of class type parameters.
@ -226,7 +226,7 @@ As a last step of finalization, types and type argument vectors get canonicalize
The VM keeps global tables of canonical types and type arguments. Canonicalizing a type or a type argument vector consists in a table look up using a hash code to find a candidate, and then comparing the type with the candidate using the `IsEquivalent` method mentioned above (passing `kind = kCanonical`).
It is therefore imperative that two canonically equal types share the same hash code. `TypeRef` objects pose a problem in this regard. Namely, the hash of a `TypeRef` node cannot depend on the hash of the referenced type graph, otherwise, the hash code would depend on the location in the cycle where hash computation started and ended. Instead, the hash of a `TypeRef` node can only depend on information obtainable by “peeking” at the referenced type node, but not at the whole referenced type graph. See the comments in the [implementation](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.cc) of `TypeRef::Hash()` for details.
It is therefore imperative that two canonically equal types share the same hash code. `TypeRef` objects pose a problem in this regard. Namely, the hash of a `TypeRef` node cannot depend on the hash of the referenced type graph, otherwise, the hash code would depend on the location in the cycle where hash computation started and ended. Instead, the hash of a `TypeRef` node can only depend on information obtainable by “peeking” at the referenced type node, but not at the whole referenced type graph. See the comments in the [implementation](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.cc) of `TypeRef::Hash()` for details.
## Cached Instantiations of TypeArguments
@ -249,5 +249,5 @@ For details, search for the string *ShareInstantiator* in the source.
## Nullability of TypeArguments
The previous section ignores an important point, namely, sharing is only allowed if the nullability of each type argument in the instantiator is not modified by the instantiation. If the new instance was allocated with `A<S?, T>()` instead, it would only work if the first type argument in the instantiator is nullable, otherwise, its nullability would change from legacy or non-nullable to nullable. This check cannot be performed at compile time and performing it at run time undermines the benefits of the optimization. However, whether the nullability will remain unchanged for each type argument in the vector can be computed quickly for the whole vector with a simple integer operation. Each type argument vector is assigned a nullability value reflecting the nullability of each one of its type arguments. Since two bits are required per type argument, there is a maximal vector length allowed to apply this optimization. For a more detailed explanation, search for `kNullabilityBitsPerType` in the [source](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.h) and read the comments.
The previous section ignores an important point, namely, sharing is only allowed if the nullability of each type argument in the instantiator is not modified by the instantiation. If the new instance was allocated with `A<S?, T>()` instead, it would only work if the first type argument in the instantiator is nullable, otherwise, its nullability would change from legacy or non-nullable to nullable. This check cannot be performed at compile time and performing it at run time undermines the benefits of the optimization. However, whether the nullability will remain unchanged for each type argument in the vector can be computed quickly for the whole vector with a simple integer operation. Each type argument vector is assigned a nullability value reflecting the nullability of each one of its type arguments. Since two bits are required per type argument, there is a maximal vector length allowed to apply this optimization. For a more detailed explanation, search for `kNullabilityBitsPerType` in the [source](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.h) and read the comments.

View file

@ -7,6 +7,6 @@ F-bounded type parameters without introducing infinite types, this
feature relies on another feature, _super-bounded types_, which is
therefore also in focus for tests in this directory. For more details,
please check the feature specifications on
[super-bounded types](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md)
[super-bounded types](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md)
and on
[instantiate to bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
[instantiate to bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).

View file

@ -7,4 +7,4 @@ previously a compile-time error, and it is intended to allow
developers to express the intent that the value of certain expressions
is of no interest, and help them to avoid using such values. For more
details, please check the
[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md).
[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md).

View file

@ -4,4 +4,4 @@ This directory was created in order to hold tests pertaining to the Dart
feature which changes the `int` type to have a fixed-size representation
(as opposed to implicitly transitioning into an arbitrary bigint
representation when needed). For more details, please check the
[informal specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md).
[informal specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md).

View file

@ -5,6 +5,6 @@ Dart feature that allows the `new` and `const` keywords on instance
creation expressions and composite literals (maps and lists) to be
omitted. For more details, please check the feature specifications
on
[optional const](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-const.md)
[optional const](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-const.md)
and on
[optional new](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new.md).
[optional new](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new.md).

View file

@ -7,6 +7,6 @@ F-bounded type parameters without introducing infinite types, this
feature relies on another feature, _super-bounded types_, which is
therefore also in focus for tests in this directory. For more details,
please check the feature specifications on
[super-bounded types](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md)
[super-bounded types](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md)
and on
[instantiate to bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
[instantiate to bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).

View file

@ -2,5 +2,5 @@
This directory holds tests for valid and invalid returns from functions. See
the
[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md) for
[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md) for
details, or the formal spec once integrated.

View file

@ -5,4 +5,4 @@ Dart feature which causes forwarding methods to be generated
implicitly for all method signatures in the interface of a class that
declares a non-trivial `noSuchMethod`. For more details, please check
the
[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/nosuchmethod-forwarding.md).
[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/nosuchmethod-forwarding.md).

View file

@ -7,4 +7,4 @@ previously a compile-time error, and it is intended to allow
developers to express the intent that the value of certain expressions
is of no interest, and help them to avoid using such values. For more
details, please check the
[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md).
[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md).