related #31613
Change-Id: Ib01771cc85be37469e7cd862ec3b25f35769db90
Reviewed-on: https://dart-review.googlesource.com/30502
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This fixes a subttle bug with patching: we were incorrectly storing the origin
uri on a private class that was only defined in a patch file (it was not a
patched class).
Change-Id: I183b8240be2f452f05bc956642363e9d125d2552
Reviewed-on: https://dart-review.googlesource.com/30387
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This updates keyword code completion to suggest 'async', 'async*',
and 'sync' in new situations. This is necessary given that the fasta
parser recovers in a slightly different way than the analyzer parser.
Change-Id: I44cb42bc02874811df94a6586c7b9c9b5d7574c9
Reviewed-on: https://dart-review.googlesource.com/30460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: Icb45e579233f567319439623d67d2a683fb13514
Reviewed-on: https://dart-review.googlesource.com/30447
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
* Fixes kernel flow graph builder to use instantiated type argumenst
for CreateArray
* Fixes prologue builder to mask the positon of named arguments in the
arguments descriptor array
* Add a SmiBitAndTOS instruction to DBC
* Implement missing AssertSubtype DBC instruction
* Ensure we don't use field guards in DBC mode
* Remove incorrect assertions in LoadIndexedUnsafe/StoreIndexedUnsafe
* Save argdesc_ in DBC simulator when calling the runtime to optimize
a function (which can call re-entrant to Simulator via const
evalulation)
Issue https://dart-review.googlesource.com/c/sdk/+/29581
Change-Id: Ia14b657db66f90643822b6986ec7f75f746ab0d8
Reviewed-on: https://dart-review.googlesource.com/30340
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: Iced3191870e83b3962937d967e2bea6a80187aa3
Reviewed-on: https://dart-review.googlesource.com/30446
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This reverts commit 2a3f00a179.
Reason for revert: SIMARM bots are timing out.
Original change's description:
> [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2.
>
> * Enable --limit-ints-to-64-bits for CFE when it is used to generate
> kernel for VM as CFE relies on int.parse being able to parse correct
> literals and reject incorrect.
>
> * Pass --limit-ints-to-64-bits to gen_kernel via environment
> variable to support batch mode compilation.
>
> * Use current Dart SDK instead of checked-in Dart SDK to run CFE
> in gen_kernel as checked-in Dart SDK is old and it doesn't have
> int.parse fix yet.
>
> Issue: https://github.com/dart-lang/sdk/issues/31339
> Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
> Reviewed-on: https://dart-review.googlesource.com/29941
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=vegorov@google.com,kustermann@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com
Change-Id: Iecf26953bc6ae95c3bf0d1142bb89fb51cb0aaee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/31339
Reviewed-on: https://dart-review.googlesource.com/30440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This reverts commit eea2c168f9.
Reason for revert: standalone_2/io/test_runner_test times out
python tools/test.py -m release -c precompiler -r dart_precompiled -a simarm64 --use-blobs standalone_2/io/test_runner_test
Original change's description:
> [vm] Detect and expand calls through getters in AOT call specializer.
>
> If we know that receiver is a subclass of a certain type and that this
> type has accessor get:m then call o.m(...) is guaranteed to be an
> invocation through a getter. Such invocations are executed most
> efficiently when expanded into o.get:m().call(...).
>
> Source based pipeline handles this case (at least for invocations on
> `this`) directly in the parser, but Kernel based graph builder does not
> have this sort of special case.
>
> Instead of teaching Kernel flow graph builder to specially handle
> invocations on `this` we teach AOT call specializer to specially handle
> all invocations where receiver is known to be a subclass of certain
> class. Such optimization is more generic and handles things that
> previously were not handled by the optimization.
>
> AOT compiler also has heuristics for injecting field dispatchers into
> classes but these heuristics only handle fields of function type and
> don't work for fields like `Function f` or `var f`.
>
> Improves ParserCombinators benchmark by 4x.
>
> Bug:
> Change-Id: I365d4fb2140577d02aefbf16fcf6be1bd12413a6
> Reviewed-on: https://dart-review.googlesource.com/29840
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=vegorov@google.com,kustermann@google.com,alexmarkov@google.com
Change-Id: I2b891b1674dd07fa43d6414428438c41e3332391
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/30400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
* Enable --limit-ints-to-64-bits for CFE when it is used to generate
kernel for VM as CFE relies on int.parse being able to parse correct
literals and reject incorrect.
* Pass --limit-ints-to-64-bits to gen_kernel via environment
variable to support batch mode compilation.
* Use current Dart SDK instead of checked-in Dart SDK to run CFE
in gen_kernel as checked-in Dart SDK is old and it doesn't have
int.parse fix yet.
Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
Reviewed-on: https://dart-review.googlesource.com/29941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
In 5a44162c97 in attempt to adhere to declared
method signatures we lost zero-copying JSON decoding of responses from
VM: `Message.sendToVM` was changed to always decode the response into
string before passing it to the caller and the logic to use fused
JSON decoding was removed. This increased peak memory consumption by
the VM Service.
This commit addresses the issue by restoring the zero-copying JSON decoding
logic while adding a wrapper around responses that make it clear what kind
of data is passed around and how that data is encoded and handled.
We introduce a class `Response` which can contain either a Dart string, a
binary data (represented as a Uint8List) or utf8 encoded string (represented
as a Uint8List). This class is used in all places where previously a String
or dynamic were used, e.g. MessageRouter.routeRequest is changed to return
Future<Response> rather than Future<String>. This allows callees to
decode JSON responses without copying them into Dart heap while
maintaining sufficient level of typing to make the code easy to reason about.
This commit also removes some dead code from the VM service related to old
Service API and TAR assets unpacking (which has been long done in C++).
Bug: https://github.com/flutter/flutter/issues/13626
Change-Id: Ifbba56944a552034a0f802a965a313326a1236e7
Reviewed-on: https://dart-review.googlesource.com/30280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This adds fasta parser recovery for missing switch blocks
and removes some redundant error checking code.
Change-Id: I92b875d31f0ada50586f5bd81e5e1c51e0c2ceec
Reviewed-on: https://dart-review.googlesource.com/30321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
If we know that receiver is a subclass of a certain type and that this
type has accessor get:m then call o.m(...) is guaranteed to be an
invocation through a getter. Such invocations are executed most
efficiently when expanded into o.get:m().call(...).
Source based pipeline handles this case (at least for invocations on
`this`) directly in the parser, but Kernel based graph builder does not
have this sort of special case.
Instead of teaching Kernel flow graph builder to specially handle
invocations on `this` we teach AOT call specializer to specially handle
all invocations where receiver is known to be a subclass of certain
class. Such optimization is more generic and handles things that
previously were not handled by the optimization.
AOT compiler also has heuristics for injecting field dispatchers into
classes but these heuristics only handle fields of function type and
don't work for fields like `Function f` or `var f`.
Improves ParserCombinators benchmark by 4x.
Bug:
Change-Id: I365d4fb2140577d02aefbf16fcf6be1bd12413a6
Reviewed-on: https://dart-review.googlesource.com/29840
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The displayName of an anonymous closure is a blank String, resulting in messages like:
[error] The return type 'String' is not a 'int', as defined by the method ''.
After this change, an error might instead look like:
$ xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --strong 26056.dart
Analyzing 26056.dart...
error • The return type 'String' isn't a 'int', as defined by anonymouse closure at 26056.dart:6:28 • return_of_invalid_type
1 error found.
Bug: https://github.com/dart-lang/sdk/issues/26056
Change-Id: I4003eea22cb23e0b06479482c06d5ce8a936c756
Reviewed-on: https://dart-review.googlesource.com/28382
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This refactors fasta parsing of switch statements so that it can
detect `case` statements after `default` statements
and duplicate `default` statements.
Change-Id: If9d2590a3563d0fe8940e9f3ed45375f2bebfa24
Reviewed-on: https://dart-review.googlesource.com/30240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This updates the fasta parser to gracefully recover
when a 'case' or 'default' keyword is not followed
by a colon.
In addition, the analyzer error code associated
with the fasta ExpectedButGot error template
has been changed
from UNEXPECTED_TOKEN
to EXPECTED_TOKEN.
Change-Id: Ic1cc01362b2ed796c0a0817504ac6aa9294fa9b3
Reviewed-on: https://dart-review.googlesource.com/30160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
The optimizer uses the "is more specific than" relation to eliminate type tests.
In strong mode, the "is more specific than" relation is supposed to be identical
to the "is subtype of" relation. However, it is not quite true, and this is the
cause of this bug. In non-strong mode (Dart 1), the "is more specific than"
relation uses covariance for both result type and parameter types of functions.
In strong mode, we need covariance of result type and contravariance of
parameter types.
Added regression test and updated status files.
Change-Id: I6315643890db75213af6720aa99d8da7b15f99d6
Bug:
Reviewed-on: https://dart-review.googlesource.com/29900
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>