I'd like to deprecate and remove the Link class,
as best as I can tell, it doesn't offer the same
performance benefits as I've seen on other platforms.
Fasta mostly uses "null" to represent empty lists, and
after the old dart2js front was deleted, there are few
uses remaining.
This CL makes it easier to find the remaining uses.
Change-Id: I73ac9b6b8b1bf5fed9669ae939cb3252cedbef0f
Reviewed-on: https://dart-review.googlesource.com/56781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This reverts commit 3e50ea32b5.
Reason for revert: Severe performance regressions on many aot-v2 benchmarks.
Original change's description:
> [vm] Support definition of entry-points via @pragma('vm.extern') annotations.
>
> The `@pragma` annotations are evaluated by the constants transformation and
> visible to TFA and the precompiler, which match on the "options" field of the
> annotation to determine whether to mark the class/procedure as a root.
>
> This required enabling the transformation of annotation constants by default.
>
> # Test Plan
>
> The "vmservice_io.main" entry-point is removed from `main.cc` and annotated with
> `@pragma`. All precompiler tests will crash if "vmservice_io.main" is not
> available at runtime.
>
> Debug/release precompiler bots are visible in "cl-linux" button.
>
> Change-Id: I03c5d6ba7918672ed9905fcaee8dabe675a93a5d
> Reviewed-on: https://dart-review.googlesource.com/56660
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com
Change-Id: I779c17d003659129a4b3fcf284423104948f60e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/56820
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
The `@pragma` annotations are evaluated by the constants transformation and
visible to TFA and the precompiler, which match on the "options" field of the
annotation to determine whether to mark the class/procedure as a root.
This required enabling the transformation of annotation constants by default.
# Test Plan
The "vmservice_io.main" entry-point is removed from `main.cc` and annotated with
`@pragma`. All precompiler tests will crash if "vmservice_io.main" is not
available at runtime.
Debug/release precompiler bots are visible in "cl-linux" button.
Change-Id: I03c5d6ba7918672ed9905fcaee8dabe675a93a5d
Reviewed-on: https://dart-review.googlesource.com/56660
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 53cd0b4af1.
The commit causes failures in the VM's precompiler because its mixin
deduplication transformation apparently needs to distinguish between
anonymous and named mixins.
Change-Id: I3861a3bf90b10f627d5fc8f0e94f117c102422d7
Reviewed-on: https://dart-review.googlesource.com/56780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
* Add app_jitk configuration to test matrix.
* Skip it on non-Dart 2 test suites.
Change-Id: I05f75dbbd33d34a4acf4df1fe63104933d39d2fe
Reviewed-on: https://dart-review.googlesource.com/56113
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL adds an example to super-bounded-types.md in order to motivate
the definition of what it means for a parameterized type based on a
type alias to be super-bounded. The definition says that we must check
the actual type arguments relative to the formal type parameter
list of the given `typedef` as well as the right hand side, replacing
the formals by the given actual type arguments. The example shows that
the right hand side can be ill-bounded even though the check that we
apply based on the formal type parameter bounds (that is, the check
that we apply to class types) succeeds.
A rendered version of super-bounded-types.md corresponding to patchset
6 is available here:
https://gist.github.com/eernstg/fc12eeb23064a2578a936b443461dde4.
Change-Id: I33dc6ced592f53160bc6f933558bfface46cd329
Reviewed-on: https://dart-review.googlesource.com/56668
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
To implement dart:mirrors correctly, a backend like the VM needs to
know that a class was originally a mixin application. Use the
`isSyntheticMixinImplementation` flag which was already there and
ignored by the VM.
Now the property is:
- if `isSyntheticMixinImplementation` is set on a class with a
mixed-in type, then it was originally an anonymous mixin application
- if `isSyntheticMixinImplementation` is set on a normal class then it
was originally a mixin application of some kind and the mixed-in
type can be found as the last impelemented type
Bug: https://github.com/dart-lang/sdk/issues/33240
Change-Id: I004adc6bfe08e583efba8e511076a6c603c0c687
Reviewed-on: https://dart-review.googlesource.com/56760
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This improves recovery when parsing type arguments in
* top level fields and functions
* class members
and when parsing type parameters in
* top level functions
* class declaration
* class methods
Change-Id: I7dbb520d6bb39c0d13b27698658dafe580f2b16c
Reviewed-on: https://dart-review.googlesource.com/56681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: I416ee350e1e7346493a3c4df3616f11d3b637d7c
Reviewed-on: https://dart-review.googlesource.com/56680
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
zx_port_wait and zx_port_queue no longer take an unused count parameter.
Change-Id: I62f03871282d076638c51527603473252821d316
Reviewed-on: https://dart-review.googlesource.com/56705
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
Since the downcast is explicit (using "as") the type will be checked
even in unchecked mode, so technically there is a slight risk of
breakage. But since the callback is so near the creation of the
ButtonElement, I'm not concerned. Also, I'm not concerned about the
performance penalty of the explicit downcast because the cost is only
paid once per user click.
Change-Id: I64fbb442985f6ba6f745f665b36a3321498025e4
Reviewed-on: https://dart-review.googlesource.com/56704
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This allows code to access a VM object's target without having to
downcast it to a more specific type.
Change-Id: I42f329e205c2da0137be2440f0d3088a7137bc55
Reviewed-on: https://dart-review.googlesource.com/56703
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
For brevity we explicitly downcast the parameter type (using "as")
rather than implicitly downcasting it (by assigning to a fresh
variable). Since this is test code, I'm not concerned about the
performance penalty of the explicit downcast.
Change-Id: I2bf1556ec11db124978c6631df8fcdd5adbc298d
Reviewed-on: https://dart-review.googlesource.com/56701
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In some cases we need to specify a type because the inferred type
would be too specific. For example, in the code:
final content = [new SampleBufferControlElement(...)];
...
content.addAll([new BRElement(), ...]);
Strong mode would infer a type of `List<SampleBufferControlElement>`
for `content`, making it impossible to add other kinds of HTML
elements to the list later. So we have to specify explicitly that the
list element type is meant to be `HTMLElement`.
In other cases we need to specify a type because the inferred type is
too general. For example, in the code:
Future<List<String>> complete(...) {
var result = [];
...add values of type String to `result`...
return new Future.value(result);
}
Strong mode would infer a type of `List<dynamic>` for `result`, making
it impossible to enclose in a `Future<List<String>>`. So we have to
specify explicitly that the list element type is meant to be `String`.
Change-Id: I1b1c884529de2775898dfff800d250cd10629811
Reviewed-on: https://dart-review.googlesource.com/56700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The types now correspond in the two classes, so we avoid invalid
override errors.
Change-Id: Iceeb324e6adf7573ae39d7250184f7eb58656498
Reviewed-on: https://dart-review.googlesource.com/56021
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Change-Id: I0a5bc5da093ad1fecdba4fc1ec8b9325f72b021a
Reviewed-on: https://dart-review.googlesource.com/56666
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I4fc8abddfc04cdde018480d7a078c46d3241b80d
Reviewed-on: https://dart-review.googlesource.com/56602
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This CL makes the following changes, which should be safe since they
don't affect Dart 1.0 semantics:
- Explicitly declare the types of certain variables as `dynamic` to
avoid strong mode inferring a type that leads to errors.
- Explicitly cast certain expressions to `dynamic` to allow access to
members that are dynamically known to be present.
- Add `covariant` annotation to method parameters that are a subtype
of the corresponding parameter in the base class.
Change-Id: Ibefe4d9591f70ea954373ca4d521bc54179cca9b
Reviewed-on: https://dart-review.googlesource.com/55900
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This should make the Link implementation work in strong mode.
We may find situations where Link<Null> leaks out, but I believe those should
be fixed by passing explicitly typed tail arguments.
Change-Id: I4c48769569f22e987ace586f5ec9264d75b49982
Reviewed-on: https://dart-review.googlesource.com/56663
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This prepares for splitting its subclasses so they can
be implemented by the analyzer.
Change-Id: I0fb59b56a6d34e86e909e6ecf68a9cdf57de44d6
Reviewed-on: https://dart-review.googlesource.com/56495
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This prepares the generator to be implemented by the analyzer.
Change-Id: Ida249f93ad0b80bb52bb3278a1e2949c668b0e64
Reviewed-on: https://dart-review.googlesource.com/56493
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Known files are only used for seaching top-level declarations.
But we already get something for user from it - we can give Quick Fix
for imports, even if the package to import is not used yet in the project.
R=brianwilkerson@google.com
Change-Id: Iaa6d7ad515325b1bad3e37e7c066c42df056c85c
Reviewed-on: https://dart-review.googlesource.com/56623
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL addresses a code pattern where a method expects its parameter
to have a certain type, but that method is torn off and passed as a
callback to another method expecting its parameter type to be more
general. For example:
void f(int i) { ... }
void g(void callback(Object o)) { ... }
void h() {
g(f); // Error: () -> int is not a subtype of () -> Object
}
This is a strong mode error because the type system cannot guarantee
that the value pased to f will be an int. The solution is to broaden
the type of the callback parameter so that it matches the type
expected for the callback. In most cases, we insert an implicit
downcast (by reassigning the parameter to a local variable with the
expected type), which in Dart 2.0 semantics will result in a runtime
check (similar to what happens in Dart 1.0 checked mode).
Since the downcasts are implicit, the Dart 1.0 semantics are
unchanged, so this should be a safe change.
Change-Id: I9583ea194343b89b39305c9796cfad299a47943f
Reviewed-on: https://dart-review.googlesource.com/55907
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
In 4cf51e6c1a, a new argument was added
to the ContextRoot constructor, changing its signature in a breaking
way.
In theory this should not have broken other packages, because
ContextRoot is declared inside analyzer/lib/src. But it turns out
that two packages are known to import from analyzer/lib/src and
construct ContextRoot: angular_analyzer_plugin and
built_value_generator. To avoid breaking these packages, we need to
add the new constructor parameter as an optional (named) parameter.
Some time after after angular_analyzer_plugin and
built_value_generator have been updated, I'll send a later CL to mark
the named parameter as @required.
Change-Id: I5be063dd47a3dfefba08cb444687b91bf2ba3625
Reviewed-on: https://dart-review.googlesource.com/56603
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL converts the remaining IdentifierContext constants
and removed now unused code from the parser.
Change-Id: I3c5add811e0e5a3af082c31bc42abda62a164307
Reviewed-on: https://dart-review.googlesource.com/56541
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
At a minimium, the image portion of the snapshot is sensitive to word size.
Change-Id: I1056a726c7b773f3ef65608f3244aaa01a366ec4
Reviewed-on: https://dart-review.googlesource.com/56023
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This reverts commit ad4cfa0260.
Reason for revert: Assertion failures on DBC
Original change's description:
> [mirrors] Add IsolateMirror.loadUri.
>
> This allows a programmer to dynamically load code into an isolate. The closest existing API is Isolate.spawnUri, but communication with the dynamically loaded code in that case is limited to asynchronous message passing of JSON-like objects.
>
> Change-Id: Icb23e9dacfb0035622c119f11d4e0f892ba2ccd1
> Reviewed-on: https://dart-review.googlesource.com/45363
> Reviewed-by: Zach Anderson <zra@google.com>
TBR=rmacnak@google.com,zra@google.com,asiva@google.com,kmillikin@google.com
Change-Id: I80669188b9f40b3b527e8e268ade0d0d514a8753
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/56640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>